TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Git-blame-someone-else – Blame someone else for your bad code

149 点作者 mablae超过 9 年前

14 条评论

SilasX超过 9 年前
Should probably use this moment to plug my (opposite) project, git-upstage, which lets you claim credit for someone else&#x27;s work and backdate it so it looks like you did it first:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;SilasX&#x2F;git-upstage" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;SilasX&#x2F;git-upstage</a>
评论 #11054532 未加载
andrewray超过 9 年前
It&#x27;s been my experience, especially in the startup scene where business requirements change often, that `git blame` rarely shows you what you want. Files get renamed, moved, re-indented, etc, frequently.<p>I wrote a tutorial on a more effective (at least for me) solution to find the true author of a change: <a href="http:&#x2F;&#x2F;blog.andrewray.me&#x2F;a-better-git-blame&#x2F;" rel="nofollow">http:&#x2F;&#x2F;blog.andrewray.me&#x2F;a-better-git-blame&#x2F;</a>
评论 #11055392 未加载
评论 #11054624 未加载
评论 #11056649 未加载
lambda超过 9 年前
Should really use &quot;git filter-branch&quot;, not &quot;git rebase -i&quot;, for automated history modifications. &quot;git rebase -i&quot; is good for interactive usage, not scripting.
andrewstuart2超过 9 年前
And this is why I pgp sign all my commits. :-P
评论 #11053326 未加载
评论 #11054366 未加载
wink超过 9 年前
This probably could be done using git filter-branch as well.<p>Not rewriting history, I still have this little script called fakecommit[0] lying around I have used in the past to commit stuff under other people&#x27;s names.<p>[0]: <a href="https:&#x2F;&#x2F;github.com&#x2F;winks&#x2F;dotfiles&#x2F;blob&#x2F;cfd9d994d0bcd7510203a7e2e6be7260b0d699aa&#x2F;bin&#x2F;fakecommit" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;winks&#x2F;dotfiles&#x2F;blob&#x2F;cfd9d994d0bcd7510203a...</a>
32bitkid超过 9 年前
Hell, I can do _all_ my work as somebody else with &quot;git config user.name&quot; and &quot;git config user.email&quot;.<p>If that&#x27;s really a genuine concern, then a) you are working with a big bag of dicks and b) there are _way_ worse things that person can do with write access to the repository than masquerade as somebody else.
评论 #11054114 未加载
LinuxBender超过 9 年前
This was also being discussed here [1]<p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11049993" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11049993</a><p>Apparently it will be obvious to folks that this has occurred.
评论 #11054335 未加载
评论 #11053693 未加载
cevaris超过 9 年前
Hey Bob, what is up with the `git push --force master`?
LinuxBender超过 9 年前
This is a good example of why git repos should be snapshot and archived to read-only media periodically.<p>I like this! Thank you
评论 #11050126 未加载
jayphelps超过 9 年前
Here&#x27;s the tweet: <a href="https:&#x2F;&#x2F;twitter.com&#x2F;_jayphelps&#x2F;status&#x2F;695782397439139840" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;_jayphelps&#x2F;status&#x2F;695782397439139840</a>
shurcooL超过 9 年前
(When I saw the title, I was wondering if this does something beyond the basic rebase, like trying to brute force a commit such that all following commits are preserved (hash doesn&#x27;t change), but that&#x27;s essentially impossible.)<p>I&#x27;m tempted to make the observation that there&#x27;s nothing here you can&#x27;t already do with a git rebase -i and:<p><pre><code> GIT_COMMITTER_NAME=a GIT_COMMITTER_EMAIL=a@a.com GIT_COMMITTER_DATE=2006-01-02T15:04:05Z git commit --author=&#x27;a &lt;a@a.com&gt;&#x27; --date 2006-01-02T15:04:05Z </code></pre> But I realize this ability will be novel&#x2F;surprising to some people, and this is meant to be a joke.<p>I don&#x27;t do this not because I can&#x27;t, but because I have no incentive to lie about who wrote&#x2F;committed certain code.
评论 #11053816 未加载
_jomo超过 9 年前
Previously on HN: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10005577" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10005577</a>
mjklin超过 9 年前
$ git push SEP-field
gcb0超过 9 年前
what&#x27;s the point? you just rebased with a incompatible tree. nobody will be able to update that because their trees will say the commit differs.<p>and in the only case this would work, i.e. nobody has that commit yet, you could just have commited as that person. nothing new or interesting.<p>now, github being garbage and not accounting for PGP signatures, now this is something else.