Paul Mackerras [off-list ref] writes:
The other option would be to make git-rev-list list the open-circle
commits explicitly, with an indication that they are not in the
requested set but are parents of commits in the requested set.
I might be off the mark, but are you thinking about something
like the attached patch?
Do you think that having the open-circle commits in the graph is
useful?
Of course.
-- >8 --
rev-list: --parents-with-boundary
The new flag acts like --parents, but uninteresting parents are
marked by prefied '-' sign.
$ git-rev-list --parents-with-boundary HEAD^^..HEAD
acb7257... 9c48666...
9c48666... -dff86e2..
---diff --git a/rev-list.c b/rev-list.c
index 441c437..58fc449 100644
--- a/rev-list.c
+++ b/rev-list.c
@@ -39,6 +39,8 @@
static int bisect_list = 0;
static int verbose_header = 0;
static int abbrev = DEFAULT_ABBREV;
+#define SHOW_PARENTS 1
+#define SHOW_PARENTS_BOUNDARY 2
static int show_parents = 0;
static int show_timestamp = 0;
static int hdr_termination = 0;
@@ -59,7 +61,11 @@
parents = parents->next;
if (o->flags & TMP_MARK)
continue;
- printf(" %s", sha1_to_hex(o->sha1));
+ if (show_parents == SHOW_PARENTS_BOUNDARY &&
+ o->flags & UNINTERESTING)
+ printf(" -%s", sha1_to_hex(o->sha1));
+ else
+ printf(" %s", sha1_to_hex(o->sha1));
o->flags |= TMP_MARK;
}
/* TMP_MARK is a general purpose flag that can@@ -337,7 +343,11 @@
continue;
}
if (!strcmp(arg, "--parents")) {
- show_parents = 1;
+ show_parents = SHOW_PARENTS;
+ continue;
+ }
+ if (!strcmp(arg, "--parents-with-boundary")) {
+ show_parents = SHOW_PARENTS_BOUNDARY;
continue;
}
if (!strcmp(arg, "--timestamp")) {