Live data from Hacker News

The shortest pull request ever

github.com

21–30 of 55 posts

Re: The shortest pull request ever

#21
post #5

Earlier quoted context omitted.

Depends on whether you consider `git commit --allow-empty` a weird quirk ... I guess it would be reasonable to do so ;).

What's the purpose of this? I can think of ways to use/abuse it, but there has to be a specific reason that it was added as a feature to git.

For those of us who start projects often, but never finish them:

    git commit --allow-empty -m "Initial commit."

Re: The shortest pull request ever

#24

My high school english classes would upload any papers students wrote to a site that would check for plagiarism. I figured out that if I inserted random zero-width no-break spaces in the middle of words my plagiarism score would drop to zero. Presumably the plagiarism system was just looking for exact matches of long substrings.

The original creator of the first zero width space had to be evil.

Re: The shortest pull request ever

#25

I mean, it's the shortest _possible_ pull request (since I don't think you can make a git diff of zero bytes, barring some weird quirk), but also probably has the highest PR description : PR diff length ratio of any PR I've seen.

Given that a BOM is three bytes, I don’t really agree that it’s the shortest. How about replacing a CRLF by LF? That one is invisible in many contexts as well.

Re: The shortest pull request ever

#26

My high school english classes would upload any papers students wrote to a site that would check for plagiarism. I figured out that if I inserted random zero-width no-break spaces in the middle of words my plagiarism score would drop to zero. Presumably the plagiarism system was just looking for exact matches of long substrings.

Somewhere someone is adding long lines of BOMs just so if someone else adds long lines of BOMs it gets flagged as plagiarism.

I hope it returns the copied string.

String "" is plagiarised

Re: The shortest pull request ever

#27

I mean, it's the shortest _possible_ pull request (since I don't think you can make a git diff of zero bytes, barring some weird quirk), but also probably has the highest PR description : PR diff length ratio of any PR I've seen.

Working in embedded, I've seen commits that changed a single bit with pages and pages of background explanation :D

Re: The shortest pull request ever

#28

> If we drop those markers (1110 and 10 in front of bytes) and keep the remaining bits we're left with 1111111011111111, which evaluates to 65279, which is in hexadecimal 0xfeff. Yes, you recognize it, it's a BOM. Because yes a BOM is just a ZERO WIDTH NO-BREAK SPACE, isn't it beautiful? Byte Order Marks have stolen hours and days of my life. Anyone suffering the pain of developing on a windows box can relate. Window…

> along with avahi daemon

Tell us more!

Re: The shortest pull request ever

#29

My high school english classes would upload any papers students wrote to a site that would check for plagiarism. I figured out that if I inserted random zero-width no-break spaces in the middle of words my plagiarism score would drop to zero. Presumably the plagiarism system was just looking for exact matches of long substrings.

The original creator of the first zero width space had to be evil.

It has uses in typesetting, e.g. for allowing a word to be broken.

Re: The shortest pull request ever

#30

> If we drop those markers (1110 and 10 in front of bytes) and keep the remaining bits we're left with 1111111011111111, which evaluates to 65279, which is in hexadecimal 0xfeff. Yes, you recognize it, it's a BOM. Because yes a BOM is just a ZERO WIDTH NO-BREAK SPACE, isn't it beautiful? Byte Order Marks have stolen hours and days of my life. Anyone suffering the pain of developing on a windows box can relate. Window…

I've dealt with two elusive bugs which were ultimately caused by Windows stupidly using UTF-8 with BOM by default. Python requires you to take extra steps to decode that garbage, and some C++ libraries can't handle it at all.

I'm sure there were good reasons that BOM sounded like the right idea at Microsoft, but everyone else just used straight UTF-8 and it was fine.

Post reply on HN