summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorAdam Simpkins <adam@adamsimpkins.net>2008-05-04 03:36:52 -0700
committerJunio C Hamano <gitster@pobox.com>2008-05-05 17:38:22 -0700
commit885cf808998c4e6d685c669a44f02b37f6965fd9 (patch)
tree793ae0c47cb768263b7e44f437fc9410c7e6f44d /revision.c
parentc697ad143ba1ff58b29e7efe149d244d4b7010a5 (diff)
downloadgit-885cf808998c4e6d685c669a44f02b37f6965fd9.tar.gz
revision API: split parent rewriting and parent printing options
This change allows parent rewriting to be performed without causing the log and rev-list commands to print the parents. Signed-off-by: Adam Simpkins <adam@adamsimpkins.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/revision.c b/revision.c
index 4231ea2cce..a813304162 100644
--- a/revision.c
+++ b/revision.c
@@ -1105,7 +1105,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
}
}
if (!strcmp(arg, "--parents")) {
- revs->parents = 1;
+ revs->rewrite_parents = 1;
+ revs->print_parents = 1;
continue;
}
if (!strcmp(arg, "--dense")) {
@@ -1524,13 +1525,13 @@ enum commit_action simplify_commit(struct rev_info *revs, struct commit *commit)
/* Commit without changes? */
if (commit->object.flags & TREESAME) {
/* drop merges unless we want parenthood */
- if (!revs->parents)
+ if (!revs->rewrite_parents)
return commit_ignore;
/* non-merge - always ignore it */
if (!commit->parents || !commit->parents->next)
return commit_ignore;
}
- if (revs->parents && rewrite_parents(revs, commit) < 0)
+ if (revs->rewrite_parents && rewrite_parents(revs, commit) < 0)
return commit_error;
}
return commit_show;