diff options
author | Elijah Newren <newren@gmail.com> | 2010-07-17 11:00:51 -0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-07-19 11:12:22 -0700 |
commit | 7f40ab0916efd56943f55fde71d917433284fef8 (patch) | |
tree | 0d1900bf841e341102febfb371a29053a071ec88 /builtin/fast-export.c | |
parent | 4087a02e452aafd0e9a6c3471c40fe76d6aafbe4 (diff) | |
download | git-7f40ab0916efd56943f55fde71d917433284fef8.tar.gz |
fast-export: Add a --full-tree option
This option adds symmetry with fast-import, enabling it to also work with
complete trees instead of just incremental changes. It works by issuing a
'deleteall' directive with each commit and then listing the full set of
files that make up that commit, rather than just showing the list of files
that have changed since the (first) parent commit. Note that this
functionality is automatically turned on when using --import-marks together
with path limiting in order to avoid dropping important but unchanged
files.
This functionality is desired when using hand-written filters along with
'fast-export | some-filter | fast-import' as it can be easier to write
<some-filter> in terms of complete trees than incremental changes.
We could avoid the need to add this option by simply always turning it on.
While the end result would be identical, it would slow things down slightly
by printing many more filenames per commit which goes somewhat against the
'fast' in 'fast-export'.
Signed-off-by: Elijah Newren <newren@gmail.com>
Acked-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fast-export.c')
-rw-r--r-- | builtin/fast-export.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/fast-export.c b/builtin/fast-export.c index 25d13a1f5a..8c7760279d 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -27,7 +27,7 @@ static enum { ABORT, VERBATIM, WARN, STRIP } signed_tag_mode = ABORT; static enum { ERROR, DROP, REWRITE } tag_of_filtered_mode = ABORT; static int fake_missing_tagger; static int no_data; -static int full_tree = 0; +static int full_tree; static int parse_opt_signed_tag_mode(const struct option *opt, const char *arg, int unset) @@ -588,6 +588,8 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) "Import marks from this file"), OPT_BOOLEAN(0, "fake-missing-tagger", &fake_missing_tagger, "Fake a tagger when tags lack one"), + OPT_BOOLEAN(0, "full-tree", &full_tree, + "Output full tree for each commit"), { OPTION_NEGBIT, 0, "data", &no_data, NULL, "Skip output of blob data", PARSE_OPT_NOARG | PARSE_OPT_NEGHELP, NULL, 1 }, |