News for hackers. Stuff that matters.
Re:Going down the rabbit hole of Git's new bundle-URI by wavemode on Monday March 17, 2025 @01:25AM (#43385424)
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.

Re:Going down the rabbit hole of Git's new bundle-URI by ithkuil on Monday March 17, 2025 @03:39AM (#43386048)
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.

Re:Going down the rabbit hole of Git's new bundle-URI by arghwhat on Monday March 17, 2025 @04:17AM (#43386215)
> 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.

Re:Going down the rabbit hole of Git's new bundle-URI by chungy on Monday March 17, 2025 @06:24AM (#43386865)
> 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.

Re:Going down the rabbit hole of Git's new bundle-URI by masklinn on Monday March 17, 2025 @07:01AM (#43387148)
> 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.