X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Fkernel-send-patches.sh;h=df041a00e3be4131cdd282cd8601cf8d955588bb;hb=c53fd54ba5bf43779d97efdfa0af2f8e58261c0d;hp=b928b32918d6ebfea845f267076e20d67578ffe5;hpb=464a8c26c891b8f2f1133ee141e81424de7d2da3;p=hvutilities.git diff --git a/scripts/kernel-send-patches.sh b/scripts/kernel-send-patches.sh index b928b32..df041a0 100755 --- a/scripts/kernel-send-patches.sh +++ b/scripts/kernel-send-patches.sh @@ -56,6 +56,7 @@ series="" resend="no" GIT_FORMAT_PATCH_SUBJECT="PATCH" skip_compile=0 +CHECKPATCH_OPS="--strict" print_usage() { @@ -63,21 +64,18 @@ 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" echo " -n dot not compile patches" + echo " -p resend patch" echo " -r really send emails (default = dry-run)" echo " -s start commit (string)" echo } -while getopts "de:f:hnrs:" flag ;do +while getopts "e:f:hnprs:" flag ;do case ${flag} in - d) - resend="yes" - ;; e) commit_end="${OPTARG}" ;; @@ -91,6 +89,9 @@ while getopts "de:f:hnrs:" flag ;do n) skip_compile=1 ;; + p) + resend="yes" + ;; r) DRY_RUN="" ;; @@ -184,6 +185,16 @@ find_commit_by_log() echo $(git log --oneline HEAD~100..HEAD | grep "${1}" | awk {'print $1'}) } +# Find SHA1 of preceding commit: +# First arg: commit message +find_preceding_commit_by_log() +{ + local sha1_end + + sha1_end="$(find_commit_by_log "${1}")" + echo $(git log --oneline ${sha1_end}~2..${sha1_end}~1 | awk {'print $1'}) +} + # Remove "Name" if present in email address. Needed because of a bug in # get_maintainer.pl even if we specify the "--non" option. # Arg #1: "Name " or "email" @@ -245,6 +256,11 @@ if [ x"${COMMIT_END_SHA1}" = x"" ]; then exit 1 fi +if echo "${commit_end}" | grep -q "^end"; then + # Take commit just before end commit: + COMMIT_END_SHA1=$(find_preceding_commit_by_log "${commit_end}") +fi + rm -rf ${srcdir}/*.patch # If the cover letter is not between start and end commits, save a copy: