Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> This has resulted in a contender for the world's smallest open source patch:

Hah, got you beat: https://github.com/eki3z/mise.el/pull/12/files

It's one ASCII character, so a one-byte patch. I don't think you can get smaller than that.




A commit which does nothing more than change permissions of a file would probably beat that, from an information theory perspective.

You might say, "nay! the octal triple of a file's unix permissions requires 3+3+3 bits, which is 9, which is greater than the 8 bits of a single ascii character!"

But, actually, Git does not support any file permissions other than 644 and 755. So a change from one to the other could theoretically be represented in just one bit of information.


> Git does not support any file permissions other than 644 and 755.

It does not but kinda does, git stores the entire unix mode in the tree object (in ascii encoded octal to boot), it has a legacy 775 mode (which gets signaled by fsck —strict, maybe, if that’s been fixed), and it will internally canonicalise all sorts of absolute nonsense.


> But, actually, Git does not support any file permissions other than 644 and 755. So a change from one to the other could theoretically be represented in just one bit of information.

Git also supports mode 120000 (symbolic links), so you could add another bit of information there.


Ok. But you need to specify the name of the file. So it also needs to be a one character filename.

I wonder if file deletion is theoretically even smaller than permission change.


> So it also needs to be a one character filename.

No one counts the path being changed, just like they also don't count the commit message, committer and author name/email, etc.


There is a cursor rendering fix in xf86-video-radeonhd (or perhaps -radeon) that flips a single bit.

It took the group several years to narrow in on.


The Dolphin patch that fixed the heat haze in Dragon Roost Island was also a single bit, changing a 3 to a 7 in source code, and also took several years.

https://dolphin-emu.org/blog/2014/01/06/old-problem-meets-it...

This comment has been delayed by about 12 hours due to the Hacker News rate limit.



What's the story behind that? Did you just deploy a blank commit to trigger a hook?


Only accepted and merged commits count!


Damn you!

I did find it a little funny that my patch was so small but my commit message was so long. Also, I haven't successfully landed it yet, I keep being too lazy to roll more versions.


That's a line modification, so presumably you'd count just an insertion or just a deletion as 'smaller'.


Yes, but so is the PR shown in the article. You're not going to get a diff that's less than one line unless you are using something besides the typical diff and patch tools.


My smallest PR was adding a missing executable file permission.


I think that wins, since presumably it was smaller than a one-byte change. I guess the smallest would be a single-bit file mode change, maybe?


Only the user permission? Or group and others also?


In terms of file contents, I have a bugfix commit somewhere that just adds a single newline to a config file (no line deleted in the diff). We were using something that had its own own custom parser for what looked like an INI file, and we managed to find an edge case where the wrong number of blank lines would break it.


Same: https://github.com/ianare/exif-py/pull/75/files

I feel like a bit of a fraud because this was the PR that got me the "Mars 2020 Contributor" badge...




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: