summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c9fc748)
raw | patch | inline | side by side (parent: c9fc748)
author | Junio C Hamano <junkio@cox.net> | |
Sun, 25 Sep 2005 06:33:02 +0000 (23:33 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 25 Sep 2005 06:33:02 +0000 (23:33 -0700) |
It was ignoring the generation number of the commit when naming 2nd
and later parents, showing "(linus^n)^2" for any <n> incorrectly as
"linus^2".
Signed-off-by: Junio C Hamano <junkio@cox.net>
and later parents, showing "(linus^n)^2" for any <n> incorrectly as
"linus^2".
Signed-off-by: Junio C Hamano <junkio@cox.net>
show-branch.c | patch | blob | history |
diff --git a/show-branch.c b/show-branch.c
index 8cc0755e0af511fd2151daeaceb7bcd5a7ec28b3..5778a594f44bd5fe06cd4b69eb37b3007a551385 100644 (file)
--- a/show-branch.c
+++ b/show-branch.c
nth++;
if (p->object.util)
continue;
- sprintf(newname, "%s^%d", n->head_name, nth);
+ switch (n->generation) {
+ case 0:
+ sprintf(newname, "%s^%d",
+ n->head_name, nth);
+ break;
+ case 1:
+ sprintf(newname, "%s^^%d",
+ n->head_name, nth);
+ break;
+ default:
+ sprintf(newname, "%s~%d^%d",
+ n->head_name, n->generation,
+ nth);
+ }
name_commit(p, strdup(newname), 0);
i++;
name_first_parent_chain(p);