git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Phil Hord <phil.hord@gmail.com>
Cc: Git <git@vger.kernel.org>, CB Bailey <cb@hashpling.org>
Subject: Re: Deadname rewriting
Date: Sat, 15 Jun 2019 10:19:02 +0200	[thread overview]
Message-ID: <87sgsb8dmx.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <CABURp0poUjSBTTFUXP8dAmJ=37qvpe64=o+t_+mHOiK9Cv+=kg@mail.gmail.com>


On Sat, Jun 15 2019, Phil Hord wrote:

> I know name-scrubbing is already covered in filter-branch and other
> places. But we have a scenario becoming more common that makes it a
> more sensitive topic.
>
> At $work we have a long time employee who has changed their name from
> Alice to Bob.  Bob doesn't want anyone to call him "Alice" anymore and
> is prone to be offended if they do.  This is called "deadnaming".
>
> We are able to convince most of our work tools to expunge the deadname
> from usage anywhere, but git stubbornly calls Bob "Alice" whenever
> someone asks for "git blame" or checks in "git log".
>
> We could rewrite history with filter-branch, but that's quite
> disruptive.  I found some alternatives.
>
> .mailmap seems perfect for this task, but it doesn't work everywhere
> (blame, log, etc.).  Also, it requires the deadname to be forever
> proclaimed in the .mailmap file itself.
>
> `git replace` works rather nicely, except all of Bob's old commits
> show "replaced" in the decorator list. Also, it doesn't propagate well
> from the central server since `refs/replaces` namespace isn't fetched
> normally.  But in case anyone wants it, here's what I did:
>
> git log --author=alice.smith --format="%h" --all |
>    while read hash ; do
>       GIT_EDITOR='sed -i -e s/Alice Smith/Bob Smith/g' -e
> 's/alice.smith/bob.smith/' \
>       git replace --edit $hash
>    done
> git push origin 'refs/replace/*:refs/replace/*'
>
> I'd quite like the .mailmap solution to work, and I might flesh that
> out that some day.
>
> It feels like `.git/info/grafts` would work the best if it could be
> distributed with the project, but I'm pretty sure that's a non-starter
> for many reasons.
>
> Any other ideas?  Has anyone here encountered this already?

What should be done is to extend the .mailmap support to other
cases. I.e. make tools like blame, shortlog etc. show the equivalent of
%aN and %aE by default.

This topic was discussed at the last git contributor summit (brought up
by CB Bailey) resulting in this patch, which I see didn't make it in &
needs to be resurrected again:
https://public-inbox.org/git/20181212171052.13415-1-cb@hashpling.org/

So, patches welcome :)

What's not going to be supported is some notion of 100% forgetting that
there was ever an Alice that's now called Bob. They did in fact create
commit objects with "Alice" in them, and low-level plumbing like
"cat-file -p <commit>" is always going to show that, and there's going
to be the mapping in .mailmap.

But as far as porcelain UI things that would show the mailmapped value
goes those can be made to always show "Bob".

Unless of course your $work is willing to completely rewrite the repo...

  parent reply	other threads:[~2019-06-15  8:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-15  1:54 Deadname rewriting Phil Hord
2019-06-15  7:27 ` Andreas Schwab
2019-06-15  8:19 ` Ævar Arnfjörð Bjarmason [this message]
2019-06-17 21:21   ` Philip Oakley
2019-06-17 22:33     ` Ævar Arnfjörð Bjarmason
2019-06-21 21:12   ` Phil Hord
2019-06-21 21:34     ` Ævar Arnfjörð Bjarmason
2019-06-21 22:16       ` CB Bailey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sgsb8dmx.fsf@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=cb@hashpling.org \
    --cc=git@vger.kernel.org \
    --cc=phil.hord@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).