Skip to content

Commit f794c23

Browse files
author
Junio C Hamano
committed
show-branch --topics: omit more uninteresting commits.
When inspecting contents of topic branches for yet-to-be-merged commits, a commit that is in the release/master branch is uninteresting. Previous round still showed them, especially, the ones before a topic branch that was forked from the release/master later than other topic branches. Signed-off-by: Junio C Hamano <[email protected]>
1 parent d51fac5 commit f794c23

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

show-branch.c

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -727,24 +727,16 @@ int main(int ac, char **av)
727727
while (seen) {
728728
struct commit *commit = pop_one_commit(&seen);
729729
int this_flag = commit->object.flags;
730+
int is_merge_point = ((this_flag & all_revs) == all_revs);
730731

731-
shown_merge_point |= ((this_flag & all_revs) == all_revs);
732+
shown_merge_point |= is_merge_point;
732733

733734
if (1 < num_rev) {
734735
int is_merge = !!(commit->parents && commit->parents->next);
735-
if (topics) {
736-
int interesting = 0;
737-
for (i = 1; i < num_rev; i++) {
738-
if ((this_flag &
739-
(1u << (i + REV_SHIFT)))) {
740-
interesting = 1;
741-
break;
742-
}
743-
}
744-
if (!interesting)
745-
continue;
746-
}
747-
736+
if (topics &&
737+
!is_merge_point &&
738+
(this_flag & (1u << REV_SHIFT)))
739+
continue;
748740

749741
for (i = 0; i < num_rev; i++) {
750742
int mark;

0 commit comments

Comments
 (0)