Also, as already noted, this overwrites all the history after the commit, making it useless.
Then people said it's a joke...
I know I will get downvoted for this comment, but How did this make to the first page of HN?
11–20 of 69 posts
Also, as already noted, this overwrites all the history after the commit, making it useless.
Then people said it's a joke...
I know I will get downvoted for this comment, but How did this make to the first page of HN?
I did it as a learning exercise, and if anyone's interested I documented the source in a lot of detail to show everything I learned along the way.[1]
[1] https://github.com/JacobEvelyn/git-self-blame/blob/master/gi...
isn't this just a wrap on top of git rebase -i HASH^; git commit --amend --author "Jhon Doe"? Also, as already noted, this overwrites all the history after the commit, making it useless. Then people said it's a joke... I know I will get downvoted for this comment, but How did this make to the first page of HN?
isn't this just a wrap on top of git rebase -i HASH^; git commit --amend --author "Jhon Doe"? Also, as already noted, this overwrites all the history after the commit, making it useless. Then people said it's a joke... I know I will get downvoted for this comment, but How did this make to the first page of HN?
This might have a serious use. I have a private repo that I worked on with my daughter. If I open source it, ideally I'd keep the chronological history but scrub her email address out of it. It's OK that all the commit hashes would change. Would I want to adapt this joke tool to that purpose, or is there an exiting tool for rewriting history that way?
git filter-branch --env-filter '
old_email=megatron@example.com
new_email=redacted
if [ "$GIT_COMMITTER_EMAIL" = "$old_email" ] ; then
export GIT_COMMITTER_EMAIL="$new_email"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$old_email" ] ; then
export GIT_AUTHOR_EMAIL="$new_email"
fi
' -- --all
This is “safe” in the sense that you can go back to the old version with the reflog if you screw things up.What is more, you can: 1. clone https://github.com/torvalds/linux into /linux" rel="nofollow">https://github.com/ /linux . 2. push a fake "torvalds" commit into your repo. 3. check the SHA of the the commit that you made. 4. the commit will be visible at the original repo URL with your SHA ( " rel="nofollow">https://github.com/torvalds/linux/commit/ ), with no indication whatsoever that this is coming from a differen…
> 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-t...
This might have a serious use. I have a private repo that I worked on with my daughter. If I open source it, ideally I'd keep the chronological history but scrub her email address out of it. It's OK that all the commit hashes would change. Would I want to adapt this joke tool to that purpose, or is there an exiting tool for rewriting history that way?
https://stackoverflow.com/questions/750172/how-to-change-the...
This might have a serious use. I have a private repo that I worked on with my daughter. If I open source it, ideally I'd keep the chronological history but scrub her email address out of it. It's OK that all the commit hashes would change. Would I want to adapt this joke tool to that purpose, or is there an exiting tool for rewriting history that way?
git filter-branch --env-filter " \
export GIT_AUTHOR_NAME=Dade\ Murphy \
GIT_AUTHOR_EMAIL=zer0cool@example.com \
GIT_COMMITTER_NAME=Dade\ Murphy \
GIT_COMMITTER_EMAIL=zer0cool@example.com"What is more, you can: 1. clone https://github.com/torvalds/linux into /linux" rel="nofollow">https://github.com/ /linux . 2. push a fake "torvalds" commit into your repo. 3. check the SHA of the the commit that you made. 4. the commit will be visible at the original repo URL with your SHA ( " rel="nofollow">https://github.com/torvalds/linux/commit/ ), with no indication whatsoever that this is coming from a differen…
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…