3 ms·
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 o
by wavemode 2y ago
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.
- ithkuil 2y agoOk. 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.
- arghwhat 2y ago> 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.
- chungy 2y ago> 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.
- masklinn 2y ago> 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.