Live data from Hacker News

Git Blame-Someone-Else

github.com

11–20 of 69 posts

Re: Git Blame-Someone-Else

#11
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?

Re: Git Blame-Someone-Else

#12
A few years ago I made a similar project with a slightly different twist: https://github.com/JacobEvelyn/git-self-blame

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...

Re: Git Blame-Someone-Else

#13

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?

agree. same question here.

Re: Git Blame-Someone-Else

#14
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?

Re: Git Blame-Someone-Else

#15

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?

[deleted]

Re: Git Blame-Someone-Else

#16
post #14

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?

The standard way to do that is with 'git filter-branch'. If your daughter’s email is megatron@example.com,

    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.

Re: Git Blame-Someone-Else

#17
post #10

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 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...

Re: Git Blame-Someone-Else

#18
post #14

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 will solve this for you:

https://stackoverflow.com/questions/750172/how-to-change-the...

Re: Git Blame-Someone-Else

#19
post #14

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"

Re: Git Blame-Someone-Else

#20
post #10

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…

I 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.
Post reply on HN