hvsp: add resend option
authorHugo Villeneuve <hugo@hugovil.com>
Tue, 11 Jul 2023 14:57:02 +0000 (10:57 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Wed, 11 Oct 2023 15:36:24 +0000 (11:36 -0400)
scripts/kernel-send-patches.sh

index 9b6f2c5..13a1ec0 100755 (executable)
@@ -53,6 +53,8 @@ compile_cmd="make"
 compile_script=/tmp/kernel-compile-script.sh
 cover="no"
 series=""
+resend="no"
+GIT_FORMAT_PATCH_SUBJECT="PATCH"
 
 print_usage()
 {
@@ -60,6 +62,7 @@ print_usage()
     echo "Usage: ${PROG_NAME} [OPTIONS...]"
     echo
     echo "Options:"
+    echo "  -d   resend patch"
     echo "  -e   end commit (string)"
     echo "  -f   folder containing patch infos"
     echo "  -h   display this help and exit"
@@ -68,8 +71,11 @@ print_usage()
     echo
 }
 
-while getopts "e:f:hrs:" flag ;do
+while getopts "de:f:hrs:" flag ;do
     case ${flag} in
+        d)
+            resend="yes"
+            ;;
         e)
             commit_end="${OPTARG}"
             ;;
@@ -271,7 +277,12 @@ if [ x"${series}" != x"" -a x"${series}" != x"1" ]; then
     GIT_FORMAT_PATCH_OPTS="${GIT_FORMAT_PATCH_OPTS} -v ${series}"
 fi
 
-git format-patch ${GIT_FORMAT_PATCH_OPTS} --output-directory=${srcdir} ${base_branch}
+if [ x"${resend}" = x"yes" ]; then
+    GIT_FORMAT_PATCH_SUBJECT="RESEND ${GIT_FORMAT_PATCH_SUBJECT}"
+fi
+
+git format-patch --subject-prefix="${GIT_FORMAT_PATCH_SUBJECT}" \
+    ${GIT_FORMAT_PATCH_OPTS} --output-directory=${srcdir} ${base_branch}
 
 if [ x"${cover}" = x"yes" ]; then
     # Replace subject line in cover letter: