5 ms·
I've never really understood Torvalds' reason for not cryptographiclly signing commits. > Btw, there's a final reason, and probably the really real one. Signin
by jimktrains2 7y ago
I've never really understood Torvalds' reason for not cryptographiclly signing commits.
> Btw, there's a final reason, and probably the really real one. Signing each commit is totally stupid. It just means that you automate it, and you make the signature worth less. It also doesn't add any real value, since the way the git DAG-chain of SHA1's work, you only ever need _one_ signature to make all the commits reachable from that one be effectively covered by that one. So signing each commit is simply missing the point.
http://git.661346.n2.nabble.com/GPG-signing-for-git-commit-td2582986.html http://git.661346.n2.nabble.com/GPG-signing-for-git-commit-t...
- Aperocky 7y agoOh, I've had that at one of the place I used to work at. The git commit tree is signed, and once a team member left no one can create branches any more because all of his commits are now insecure. Yeah that was fun.
- Roritharr 7y agoI guess he's of the school that it doesn't matter who commits the code, it needs to be checked anyway, for bugs or being malicious.
- utopian3 7y agoUnless I am missing something, his point seems to be different. He doesn’t seem to care about the non-repudiation of a user
- tux1968 7y agoBecause each commit is in a cryptographically secure chain, when you sign a Git tag it vouches for the referenced commit and all the commits preceding it. This can be done at important moments such as each release.
- jimktrains2 7y agoSure, but in the case presented by great-grand-parent is a leaf commit with an unknown providence. At the very least I don't think it's "totally stupid", even if I know it's not a panacea for all ills.
- gus_massa 7y agoCryptographically signing the commits makes rebasing impossible (or at least more difficult). In some cases the rebase is very clean, and none of the modified files had changed by other commits. I guess in this case, git can have a rule to keep a "link" to the old commit and accept the old signature as a signature of the new commit. In some cases there are trivial changes, like indentation because someone else added an `if` around the code you are modifying. Sometimes part of the problem has been fixed. Sometimes one of the functions you use has an additional parameter. Sometimes the code has been moved to another file. In this cases it is difficult to automatically detect if the new rebased commit is equal enough to the old commit to accept the new signature. We can go into the big rebase/merge debate. Linus is in the rebase camp.
- mh8h 7y agoThat's because you are not supposed to rebase other people's code on top of a changed base. That can effectively modify the behaviour of their code change. So it's good that the resulting commit won't be signed anymore. And if you are rebasing your own code, then you can sign it again.
- gus_massa 7y agoWhat about cherrypicking bug fixes to old versions?
- jimktrains2 7y agoCherry picking creates a new commit.
- gus_massa 7y agoThe cherry picked comment usually has the same author and date that the original commit. (Note that rebasing also creates a new commit.) One of the latest commits backported to Linux 4.9.something https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.9.y&id=8d8276867b5ac539f1d6e166a028b51c8b1ceda8 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux... Cherrypicked from https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=master&id=060423bfdee3f8bc6e2c1bac97de24d5415e2bc4 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux... Note that the changes are identical, just add ` &&ret` twice, but the line numbers have changed. Also, the cherrypicked version has an additional `Signed-off-by: `.