summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c697ad1)
raw | patch | inline | side by side (parent: c697ad1)
author | Adam Simpkins <adam@adamsimpkins.net> | |
Sun, 4 May 2008 10:36:52 +0000 (03:36 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 6 May 2008 00:38:22 +0000 (17:38 -0700) |
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>
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>
builtin-rev-list.c | patch | blob | history | |
log-tree.c | patch | blob | history | |
revision.c | patch | blob | history | |
revision.h | patch | blob | history |
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index edc0bd35bb0e96a230284250dc4c40776cf7caac..476a870c7dda6c5aaa1eaa5fecb9c12612cf49ea 100644 (file)
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
stdout);
else
fputs(sha1_to_hex(commit->object.sha1), stdout);
- if (revs.parents) {
+ if (revs.print_parents) {
struct commit_list *parents = commit->parents;
while (parents) {
printf(" %s", sha1_to_hex(parents->item->object.sha1));
diff --git a/log-tree.c b/log-tree.c
index d3fb0e520c749e0d57afaab7666861a1a4e7cd9f..74829d720feebcc11415a3791590d7c05b0351c7 100644 (file)
--- a/log-tree.c
+++ b/log-tree.c
putchar('>');
}
fputs(diff_unique_abbrev(commit->object.sha1, abbrev_commit), stdout);
- if (opt->parents)
+ if (opt->print_parents)
show_parents(commit, abbrev_commit);
show_decorations(commit);
putchar(opt->diffopt.line_termination);
}
fputs(diff_unique_abbrev(commit->object.sha1, abbrev_commit),
stdout);
- if (opt->parents)
+ if (opt->print_parents)
show_parents(commit, abbrev_commit);
if (parent)
printf(" (from %s)",
diff --git a/revision.c b/revision.c
index 4231ea2cce57c74a4110c9c69459a4caf67dc15c..a813304162afbe7c9ecf8de3d3e9a57d3f60e48a 100644 (file)
--- 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;
diff --git a/revision.h b/revision.h
index 31217f8c67307aa09c2f470ccdbdebd5c2445890..201bd97c58d7852d07560e5f79c7dcd850803dc7 100644 (file)
--- a/revision.h
+++ b/revision.h
unpacked:1, /* see also ignore_packed below */
boundary:2,
left_right:1,
- parents:1,
+ rewrite_parents:1,
+ print_parents:1,
reverse:1,
cherry_pick:1,
first_parent_only:1;