Skip to content

Commit 917438f

Browse files
committed
Squash skipping X since it's merged... messages into one
1 parent 7dd32a2 commit 917438f

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

git_machete/cmd.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,17 +1492,19 @@ def get_root_of(b):
14921492
u = up_branch[b]
14931493
if is_merged_to(b, u):
14941494
debug("discover_tree()", "inferred upstream of %s is %s, but %s is merged to %s; skipping %s from discovered tree\n" % (b, u, b, u, b))
1495-
warn("skipping branch `%s` since it's merged to `%s`" % (b, u))
14961495
merged_branches_to_skip += [b]
1497-
managed_branches = excluding(managed_branches, merged_branches_to_skip)
1498-
for b in merged_branches_to_skip:
1499-
u = up_branch[b]
1500-
down_branches[u] = excluding(down_branches[u], [b])
1501-
del up_branch[b]
1502-
# We're NOT applying the removal process recursively,
1503-
# so it's theoretically possible that some merged branches became childless
1504-
# after removing the outer layer of childless merged branches.
1505-
# This is rare enough, however, that we can pretty much ignore this corner case.
1496+
if merged_branches_to_skip:
1497+
warn("skipping %s since %s merged to another branch and would not have any downstream branches.\n"
1498+
% (", ".join("`" + b + "`" for b in merged_branches_to_skip), "it's" if len(merged_branches_to_skip) == 1 else "they're"))
1499+
managed_branches = excluding(managed_branches, merged_branches_to_skip)
1500+
for b in merged_branches_to_skip:
1501+
u = up_branch[b]
1502+
down_branches[u] = excluding(down_branches[u], [b])
1503+
del up_branch[b]
1504+
# We're NOT applying the removal process recursively,
1505+
# so it's theoretically possible that some merged branches became childless
1506+
# after removing the outer layer of childless merged branches.
1507+
# This is rare enough, however, that we can pretty much ignore this corner case.
15061508

15071509
print(bold("Discovered tree of branch dependencies:\n"))
15081510
status(warn_on_yellow_edges=False)
@@ -1637,7 +1639,7 @@ def get_overridden_fork_point(b):
16371639
return None
16381640
debug("get_overridden_fork_point(%s)" % b,
16391641
"since branch %s is descendant of while_descendant_of=%s, fork point of %s is overridden to %s" %
1640-
(b, short_commit_sha_by_revision(while_descendant_of), b, to))
1642+
(b, while_descendant_of, b, to))
16411643
return to
16421644

16431645

0 commit comments

Comments
 (0)