diff options
author | Jeff King <peff@peff.net> | 2014-08-27 13:01:28 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-08-27 10:42:16 -0700 |
commit | a8722750985a53cc502a66ae3d68a9e42c7fdb98 (patch) | |
tree | 31892a12522ed3f217be7a3ce96c4e5d2c3173be /Documentation/git-merge-file.txt | |
parent | Git 2.1 (diff) | |
download | tgif-a8722750985a53cc502a66ae3d68a9e42c7fdb98.tar.xz |
teach fast-export an --anonymize option
Sometimes users want to report a bug they experience on
their repository, but they are not at liberty to share the
contents of the repository. It would be useful if they could
produce a repository that has a similar shape to its history
and tree, but without leaking any information. This
"anonymized" repository could then be shared with developers
(assuming it still replicates the original problem).
This patch implements an "--anonymize" option to
fast-export, which generates a stream that can recreate such
a repository. Producing a single stream makes it easy for
the caller to verify that they are not leaking any useful
information. You can get an overview of what will be shared
by running a command like:
git fast-export --anonymize --all |
perl -pe 's/\d+/X/g' |
sort -u |
less
which will show every unique line we generate, modulo any
numbers (each anonymized token is assigned a number, like
"User 0", and we replace it consistently in the output).
In addition to anonymizing, this produces test cases that
are relatively small (compared to the original repository)
and fast to generate (compared to using filter-branch, or
modifying the output of fast-export yourself). Here are
numbers for git.git:
$ time git fast-export --anonymize --all \
--tag-of-filtered-object=drop >output
real 0m2.883s
user 0m2.828s
sys 0m0.052s
$ gzip output
$ ls -lh output.gz | awk '{print $5}'
2.9M
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-merge-file.txt')
0 files changed, 0 insertions, 0 deletions