cybre.space has reached the end-of-life and is now read-only. Please see the EOL announcement for details
Follow

git should come out with a command called `git deadname-killer` that rewrites the history to search/replace commit author name

if anyone has a oneliner for this it would be much appreciated

@SuricrasiaOnline github has a bash script on their site somewhere, but they really should make it easier

@SuricrasiaOnline I once did that kind of thing, but I don't remember the exact command (sorry). Apparently, the help of "git filter-branch" gives an example to change some emails on the whole repo, so you could do the same with the author name.

@SuricrasiaOnline used to have one, not sure where it went though

git filter-repo is probably the more robust solution anyway, it can take a mailmap and rewrite history with it

@SuricrasiaOnline I have corrected deadnames and removed leaked committer & author PII from git multiple times now, but do not have such a one-liner. I have a couple to do now, so it's about time to write a script. There are multiple decisions & gotchas, which become apparent if you look at the names & dates in git log --pretty=fuller and consider the implications of changing every commit hash after the first commit you edit.

I'll post my script & a write-up here when I have it.

@SuricrasiaOnline

with git-filter-repo github.com/newren/git-filter-r this should work

git filter-repo --mailmap <(echo "name <email>")

@SuricrasiaOnline write out a .mailmap file and run git-filter-repo (third party) on it to bake in the edits

cool fact: the person who added the .mailmap thing did it expressly for this!

@SuricrasiaOnline every Unix program should also come with a closet-handler so i can manage which names i see based on who’s around

@Lucretia-Matt @SuricrasiaOnline loosely related, when is gitlab going to actually start using the .mailmap file for contributors...?

Sign in to participate in the conversation
Cybrespace

the mastodon instance at cybre.space is retired

see the end-of-life plan for details: https://cybre.space/~chr/cybre-space-eol