git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG] fast-export --anonymize does not maintain fixup! commits

From
Jeff King <peff@peff.net>
Date
May 12, 2017, 09:22 UTC
Message-ID
<20170512092212.wpw232jfpp3bnqol@sigill.intra.peff.net>
In-Reply-To
<CAHGBnuOzWSCR9wr=TSGoJSnimZDx2Gr-eR3+LFXmpc9m0cv4qw@mail.gmail.com>
On Thu, May 11, 2017 at 04:38:17PM +0200, Sebastian Schuberth wrote:
Show 8 quoted lines
> I just tried to created an anonymized repo to allow the list to
> reproduce a bug in "rebase -i" I discovered in Git 2.13 for Linux
> (Windows is not affected). However, in order to reproduce the bug it's
> important to keep the "fixup!" prefixes as part of the commit
> messages. Unfortunately, "fast-export --anonymize" does not maintain
> these (or any other command prefixes in commit messages). Given that
> the --anonymize option is explicitly designed to help reproducing
> bugs, I consider this to be a bug in the --anonymize option itself.
Yes, it probably should handle those prefixes.
I don't know if I'd call it a bug. Maybe a missing feature. :)

My plan when implementing "--anonymize" was to err on the side of simplicity and dropping information, since the most important function is not revealing anonymized data. And then we could add back in useful bits of data as they were determined to be useful and harmless.

So this seems like a good example of that. I think I'd prefer to see us add in known prefixes like "fixup!" and "squash!" then try to guess what other prefixes might be OK. I don't know of any other command prefixes besides those two, so maybe that's all you were suggesting.

It shouldn't be too hard to add. You'd probably need to make two adjustments to anonymize_commit_message():

  1. Teach it to store the mapping of anonymized messages, using
     anonymize_mem().
  2. Parse "fixup! <msg>" and just anonymize_mem() the second half. I
     think technically this wouldn't handle a fixup-of-fixup, but I
     don't think rebase handles recursive ones anyway.
-Peff
Previous: Sebastian SchuberthNext: Sebastian Schuberth
Message 2 of 3 in “[BUG] fast-export --anonymize does not maintain fixup! commits”
  1. Sebastian SchuberthMay 11, 2017
  2. Jeff KingMay 12, 2017
  3. Sebastian SchuberthMay 12, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.