News for hackers. Stuff that matters.
Re:Git Blame-Someone-Else by brlewis on Friday September 20, 2019 @08:34AM (#21025964)
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 by klodolph on Friday September 20, 2019 @08:42AM (#21026020)
The standard way to do that is with 'git filter-branch'. If your daughter’s email is [email protected],

    git filter-branch --env-filter '
    [email protected]
    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 by saidajigumi on Friday September 20, 2019 @12:53PM (#21028789)
Seconded. The git blame-someone-else tool is just using git rebase and git commit --amend internally to alter one specified commit.

git filter-branch is perfect for this kind of wholesale revision. filter-branch is essential for tasks like: open-sourcing repos that need some kind of cleanup, massaging repos generated by a VCS migration tool, etc. For example, years ago I participated in the move of a large CVS repo to git; there was significant filter-branch post-processing required to create an acceptable baseline)

Re:Git Blame-Someone-Else by justtopostthis3 on Friday September 20, 2019 @08:44AM (#21026039)

  git filter-branch --env-filter " \
    export GIT_AUTHOR_NAME=Dade\ Murphy \
           [email protected] \
           GIT_COMMITTER_NAME=Dade\ Murphy \
           [email protected]"
Re:Git Blame-Someone-Else by owenmarshall on Friday September 20, 2019 @08:42AM (#21026027)
git filter-branch will solve this for you:

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

Re:Git Blame-Someone-Else by i_v on Friday September 20, 2019 @01:27PM (#21029149)
GitHub also supports a special <username>@users.noreply.github.com address if you wanted her to retain semi-anonymous authorship as a GitHub user.
Re:Git Blame-Someone-Else by brlewis on Friday September 20, 2019 @03:13PM (#21030193)
The repo is on gitlab, but I can always make up a noreply address.