summaryrefslogtreecommitdiff
path: root/builtin/fast-export.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-08-31 16:15:20 -0700
committerJunio C Hamano <gitster@pobox.com>2010-08-31 16:15:20 -0700
commit1253164c8badf75034b8ba7c1cfabb1993fa7cf7 (patch)
treeb3a61d96af86449a938e4fa45b43390dd4fd0660 /builtin/fast-export.c
parenta621859101370205d89a6fea7ba17839a43eb4ab (diff)
parent7f40ab0916efd56943f55fde71d917433284fef8 (diff)
downloadgit-1253164c8badf75034b8ba7c1cfabb1993fa7cf7.tar.gz
Merge branch 'en/fast-export-fix'
* en/fast-export-fix: fast-export: Add a --full-tree option fast-export: Fix dropping of files with --import-marks and path limiting
Diffstat (limited to 'builtin/fast-export.c')
-rw-r--r--builtin/fast-export.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index ab792d5db2..66cafe6330 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -27,6 +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;
static int parse_opt_signed_tag_mode(const struct option *opt,
const char *arg, int unset)
@@ -241,7 +242,8 @@ static void handle_commit(struct commit *commit, struct rev_info *rev)
message += 2;
if (commit->parents &&
- get_object_mark(&commit->parents->item->object) != 0) {
+ get_object_mark(&commit->parents->item->object) != 0 &&
+ !full_tree) {
parse_commit(commit->parents->item);
diff_tree_sha1(commit->parents->item->tree->object.sha1,
commit->tree->object.sha1, "", &rev->diffopt);
@@ -281,6 +283,8 @@ static void handle_commit(struct commit *commit, struct rev_info *rev)
i++;
}
+ if (full_tree)
+ printf("deleteall\n");
log_tree_diff_flush(rev);
rev->diffopt.output_format = saved_output_format;
@@ -584,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 },
@@ -608,6 +614,9 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
if (import_filename)
import_marks(import_filename);
+ if (import_filename && revs.prune_data)
+ full_tree = 1;
+
get_tags_and_duplicates(&revs.pending, &extra_refs);
if (prepare_revision_walk(&revs))