]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
SCRIPTS: git-show-backports: list new commits and how to review them with -L
authorWilly Tarreau <w@1wt.eu>
Tue, 31 Mar 2026 07:17:03 +0000 (09:17 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Mar 2026 07:21:49 +0000 (09:21 +0200)
The new "-L" option is convenient for quick backport sessions, but it
doesn't list the commit subjects nor the review command. Let's just add
these to ease backport sessions. However we don't do it in quiet mode
(-q) because the output is sometimes parsed by automatic backport
scripts.

scripts/git-show-backports

index 10b666fc3a073a11f28d054b7e7363a414fad10e..3a3cd5f71dbb390f8ef28c55c3429d9adab1c04b 100755 (executable)
@@ -336,6 +336,16 @@ dump_commit_matrix | column -t | \
        elif [ -n "$SINCELAST" ]; then
                echo "Found ${#since_last[@]} commit(s) added to branch $REF since last backported commit $last_bkp:"
                echo
+               if [ -z "$QUIET" ]; then
+                       for c in "${since_last[@]}"; do
+                               echo "$(git log -1 --pretty="  %h  | %s" "$c")"
+                       done
+                       echo
+                       echo "In order to show and/or apply them all to current branch :"
+                       echo
+                       echo "   git show --pretty=format:'%C(yellow)commit  %H%C(normal)%nAuthor: %an <%ae>%nDate:   %aD%n%n%C(green)%C(bold)git cherry-pick -sx %h%n%n%w(0,4,4)%B%N' ${since_last[@]}"
+                       echo
+               fi
                echo "   git cherry-pick -sx ${since_last[@]}"
                echo
        elif [ -n "$MISSING" -a ${#left_commits[@]} -eq 0 ]; then