]> git.ozlabs.org Git - next-scripts/commitdiff
dup_commit: cope with a different tree and multiple commits
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 10 Jul 2024 02:34:11 +0000 (12:34 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 10 Jul 2024 02:34:11 +0000 (12:34 +1000)
dup_commit

index 75627b6cfa69862640f952293a0f41f74aed577c..f18cea89b31d310d603955db5fbc767a7df3a58b 100755 (executable)
@@ -1,12 +1,24 @@
 #!/bin/bash
 
-subject="duplicate patches in the BRANCH tree"
-
 tools_dir=$(dirname "$0")
-"$tools_dir"/message_helper "$@" "$subject" <<EOF
-The following commits are also in Linus Torvalds' tree as different commits
-(but the same patches):
 
-EOF
+subject='duplicate patch in the BRANCH tree'
+obranch="Linus Torvalds'"
+
+if [ "X$1" = "X-o" ]; then
+       shift
+       obranch="the $1"
+       shift
+fi
+
+body="The following commit is also in $obranch tree as a different commit (but the same patch):"
+
+if [ "X$1" = "X-p" ]; then
+       shift
+       subject="duplicate patches in the BRANCH tree"
+       body="The following commits are also in $obranch tree as different commits (but the same patches):"
+fi
+
+printf '%s\n' "$body" | fmt | "$tools_dir"/message_helper "$@" "$subject"
 
 exit 0