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

Re: [PATCH] teach fast-export an --anonymize option

From
Jeff King <peff@peff.net>
Date
Aug 21, 2014, 22:49 UTC
Message-ID
<20140821224910.GB21105@peff.net>
In-Reply-To
<xmqqiollqzel.fsf@gitster.dls.corp.google.com>
On Thu, Aug 21, 2014 at 02:57:22PM -0700, Junio C Hamano wrote:
Show 11 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > +--anonymize::
> > +	Replace all paths, blob contents, commit and tag messages,
> > +	names, and email addresses in the output with anonymized data,
> > +	while still retaining the shape of history and of the stored
> > +	tree.
> 
> Sometimes branch names can contain codenames the project may prefer
> to hide from the general public, so they may need to be anonymised
> as well.

Yes, I do anonymize them (and check it in the tests). See anonymize_refname. I just forgot to include it in the list. Trivial squashable patch is below.

The few things I don't anonymize are:
  1. ref prefixes. We see the same distribution of refs/heads vs
     refs/tags, etc.
  2. refs/heads/master is left untouched, for convenience (and because
     it's not really a secret). The implementation is lazy, though, and
     would leave "refs/heads/master-supersecret", as well. I can tighten
     that if we really want to be careful.
  3. gitlinks are left untouched, since sha1s cannot be reversed. This
     could leak some information (if your private repo points to a
     public, I can find out you have it as submodule). I doubt it
     matters, but we can also scramble the sha1s.
---
diff --git a/Documentation/git-fast-export.txt b/Documentation/git-fast-export.txt
index 0ec7cad..52831fa 100644
--- a/Documentation/git-fast-export.txt
+++ b/Documentation/git-fast-export.txt
@@ -106,10 +106,10 @@ marks the same across runs.
 	different from the commit's first parent).
 
 --anonymize::
-	Replace all paths, blob contents, commit and tag messages,
-	names, and email addresses in the output with anonymized data,
-	while still retaining the shape of history and of the stored
-	tree.
+	Replace all refnames, paths, blob contents, commit and tag
+	messages, names, and email addresses in the output with
+	anonymized data, while still retaining the shape of history and
+	of the stored tree.
 
 --refspec::
 	Apply the specified refspec to each ref exported. Multiple of them can
Previous: Junio C HamanoNext: Jeff King
Message 5 of 21 in “teach fast-export an --anonymize option”
  1. teach fast-export an --anonymize optionJeff King, Aug 21, 2014
  2. Junio C HamanoAug 21, 2014
  3. Jeff KingAug 21, 2014
  4. Junio C HamanoAug 21, 2014
  5. Jeff KingAug 21, 2014
  6. teach fast-export an --anonymize optionJeff King, Aug 21, 2014
  7. Duy NguyenAug 22, 2014
  8. Philip OakleyAug 22, 2014
  9. Jeff KingAug 23, 2014
  10. Junio C HamanoAug 27, 2014
  11. Jeff KingAug 27, 2014
  12. teach fast-export an --anonymize optionJeff King, Aug 27, 2014
  13. Duy NguyenAug 28, 2014
  14. Jeff KingAug 28, 2014
  15. Ramsay JonesAug 28, 2014
  16. Junio C HamanoAug 28, 2014
  17. Jeff KingAug 28, 2014
  18. Junio C HamanoAug 28, 2014
  19. Jeff KingAug 28, 2014
  20. Eric SunshineAug 31, 2014
  21. Jeff KingAug 31, 2014

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.