sort_in_topological_order(): avoid setting a commit flag · wolfpython/git@e358f3c · GitHub
Skip to content

Commit e358f3c

Browse files
dschogitster
authored andcommitted
sort_in_topological_order(): avoid setting a commit flag
We used to set the TOPOSORT flag of commits during the topological sorting, but we can just as well use the member "indegree" for it: indegree is now incremented by 1 in the cases where the commit used to have the TOPOSORT flag. This is the same behavior as before, since indegree could not be non-zero when TOPOSORT was unset. Incidentally, this fixes the bug in show-branch where the 8th column was not shown: show-branch sorts the commits in topological order, assuming that all the commit flags are available for show-branch's private matters. But this was not true: TOPOSORT was identical to the flag corresponding to the 8th ref. So the flags for the 8th column were unset by the topological sorting. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent ce567d1 commit e358f3c

3 files changed

Lines changed: 8 additions & 10 deletions

File tree

commit.c

Lines changed: 6 additions & 7 deletions

revision.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
#define CHILD_SHOWN (1u<<6)
1313
#define ADDED (1u<<7) /* Parents already parsed and added? */
1414
#define SYMMETRIC_LEFT (1u<<8)
15-
#define TOPOSORT (1u<<9) /* In the active toposort list.. */
16-
#define ALL_REV_FLAGS ((1u<<10)-1)
15+
#define ALL_REV_FLAGS ((1u<<9)-1)
1716

1817
struct rev_info;
1918
struct log_info;

t/t3202-show-branch-octopus.sh

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)