SCRIPTS: git-show-backports: make -m most only show the left branch

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.
This commit is contained in:
Willy Tarreau 2020-07-31 16:38:57 +02:00
parent 3f3cc8c8c7
commit f456f6f2a3

View File

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