TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A Git Horror Story: Repository Integrity With Signed Commits

89 pointsby primrootalmost 11 years ago

8 comments

Mithaldualmost 11 years ago
<p><pre><code> &gt; What shall we do, then, if we receive a pull request for a &gt; certain feature or bugfix with, say, 300 commits &gt; 1. Request that the user squash all the commits into a &gt; single commit &gt; 2. Adopt a security policy that requires signing only the &gt; merge commit (forcing a merge commit to be created with &gt; --no-ff if needed). &gt; 3. Sign each commit to be introduced by the merge. </code></pre> Or, tell them to rebase their branch on master, while cleaning up all their &quot;oops&quot;, &quot;revert&quot;, &quot;typo&quot;, &quot;debug&quot; and whatnot commits; resulting in a sane history and 20 commits to be signed. I find this oversight especially sarcastic as he mentions how 2. ruins git bisect, while such uncleaned 300 commit branches ruin it just as effectively, as you can never be quite sure whether the commit you arrive at isn&#x27;t reverted by one 20 commits later and the real issue was introduced another 20 commits later.
评论 #7829605 未加载
评论 #7829469 未加载
busteralmost 11 years ago
To be honest, i feel like git really needs better wrappers or a better GUI or better defaults. There shouldn&#x27;t be a quadrillion command flags to know for simple tasks like this. And i don&#x27;t mean the -S but the &quot;use -S instead of -s but for other things use -asm, oh and then you have command xyz which takes --&lt;long option&gt; followed by other options, but only use those if your SHA hash can be divided by 3.141 and it&#x27;s full moon&quot;.
评论 #7832103 未加载
评论 #7829881 未加载
评论 #7829278 未加载
评论 #7829968 未加载
gryalmost 11 years ago
Previously: <a href="https://news.ycombinator.com/item?id=4007229" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=4007229</a>
ushialmost 11 years ago
Discussion from 2 years ago:<p><a href="https://news.ycombinator.com/item?id=4007229" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=4007229</a>
lmmalmost 11 years ago
You&#x27;re supposed to sign a tag because you&#x27;ve reviewed that tag, not just at random. A commit is much less meaningful - do you always check the diff before you commit?
评论 #7828863 未加载
评论 #7828649 未加载
jaboutboulalmost 11 years ago
Wasn&#x27;t this posted a couple months ago?
codemacalmost 11 years ago
Any discussion of how projects like monotone defeat this?
jrockwayalmost 11 years ago
Alternative advice that helps avoid this problem:<p>Do code reviews.<p>Write tests.
评论 #7828340 未加载