]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
SCRIPTS: git-show-backports: make -m most only show the left branch
authorWilly Tarreau <w@1wt.eu>
Fri, 31 Jul 2020 14:38:57 +0000 (16:38 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 31 Jul 2020 14:57:09 +0000 (16:57 +0200)
We've never used the output of the rightmost branch with this tool,
and it systematically causes two identical outputs making the job
harder during backport sessions. Let's simply remove the right part
when it's identical to the left one. This also adds a few line feeds
to make the output more readable.

scripts/git-show-backports

index 4c6ccee76f5d08a7ac79ec536c042daddaa9e364..d01f92ce167a2b5ea51b207dc9f6bcb57002efe2 100755 (executable)
@@ -248,13 +248,19 @@ dump_commit_matrix | column -t | \
        if [ -n "$MISSING" -a ${#left_commits[@]} -eq 0 ]; then
                echo "No missing commit to apply."
        elif [ -n "$MISSING" ]; then
+               echo
                echo
                echo "In order to show and/or apply all leftmost commits to current branch :"
                echo "   git show ${left_commits[@]}"
+               echo
                echo "   git cherry-pick -sx ${left_commits[@]}"
                echo
-               echo "In order to show and/or apply all rightmost commits to current branch :"
-               echo "   git show ${right_commits[@]}"
-               echo "   git cherry-pick -sx ${right_commits[@]}"
+               if [ "${left_commits[*]}" != "${right_commits[*]}" ]; then
+                       echo "In order to show and/or apply all rightmost commits to current branch :"
+                       echo "   git show ${right_commits[@]}"
+                       echo
+                       echo "   git cherry-pick -sx ${right_commits[@]}"
+                       echo
+               fi
        fi
 )