Live data from Hacker News

The shortest pull request ever

github.com

31–40 of 55 posts

Re: The shortest pull request ever

#31

> 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!

Back in 2014 I was trying to set up a Linux machine and bind it to the active directory domain at work. The active directory domain was a .local domain, but avahi Daemon thinks any packet that's bound for a DOT local address is addressed to it. So it would swallow up all the packets that were headed to the domain controller, look at them, think they were weird and not understand them and then drop them on the floor. From my perspective it looked like the firewall just hated me.

It was like a week or two later until I finally went to my friend and said I must be stupid but I can't do this it's not working and he just disabled the avahi daemon and everything started working again.

Blarg.

Re: The shortest pull request ever

#32

Earlier quoted context omitted.

> along with avahi daemon Tell us more!

Back in 2014 I was trying to set up a Linux machine and bind it to the active directory domain at work. The active directory domain was a .local domain, but avahi Daemon thinks any packet that's bound for a DOT local address is addressed to it. So it would swallow up all the packets that were headed to the domain controller, look at them, think they were weird and not understand them and then drop them on the floor.…

Oof. On the other hand...

> The active directory domain was a .local domain

.local is a reserved domain for mDNS (aka ZeroConf or Bonjour, the stuff Avahi handles), standardized in early 2013.

Then again, 2014 is soon enough after for that for knowledge not to have percolated everywhere, and/or for it to stomp on older networks that had used .local beforehand.

Re: The shortest pull request ever

#33
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.

I use it extensively for entire PR based development; that way all the code that ended up in the repo has had multiple eyes (and an opportunity to comment) upon it

    git commit --allow-empty -m "initial"
    git push -u origin HEAD
    git checkout -b first-pr
    # type-y type-y

Re: The shortest pull request ever

#34

Earlier quoted context omitted.

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.

I see `--allow-empty` in git tutorials all the time, to demonstrate the concept of a commit. I'm not sure when you'd reach for it in a real repo though

The most obvious reason not involving automated systems is to create a repo’s initial ref. This can be useful on teams who are super strict about review process and git history.

Once you account for automated systems, many other reasons can arise. Not just the “trigger CI” case mentioned in another comment, triggering builds or processes based on remote content the code accesses, or generating something either random or seeded by the commit hash/timestamp/message/etc.

It can even be a Homer Simpson-style drinking bird button press, so finished software doesn’t get mistaken for abandoned.

Probably whole worlds of things I haven’t imagined because I don’t use git hooks or submodules.

Re: The shortest pull request ever

#35
You can easily check in your CI that your files are ASCII (code should probably be) with file(1). There is probably an off-the-shelf-tool that can validate that all characters are printable, ASCII or unicode.

Re: The shortest pull request ever

#36

> 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…

> nobomb

Sounds like that is a good choice for the option name

Re: The shortest pull request ever

#38

> 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 have written a cross platform, stand alone CLI program to inspect a file for BOM8 and BOM16. It also detects if a file uses CRLF or LF. Tab and nul characters are also evaluated. Please see the Examples in my repo:

https://github.com/jftuga/chars

Re: The shortest pull request ever

#39
post #9

> 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…

> Byte Order Marks have stolen hours and days of my life. Me too, to some degree. I have discovered them in a Ruby code base at work, in the middle of a line of code (copy pasted), where the Ruby interpreter thinks they are undeclared identifiers. When the code runs, it throws an exception every time that complains of “Undeclared identifier `‘”. The dad-joke of it is that “You gotta sweep for BOMs before they blow up…

See my other comment in this thread about my project:

https://github.com/jftuga/chars

Post reply on HN