X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=build%2Fcommit-msg;h=bb771b598d2b74301c67ec607f9b4f0c4e4d37aa;hb=3a92c850b094019e556577ec6cab5907538dcbf5;hp=02d704d6b85ccfde7327af34cb28d94282296b65;hpb=f40494c72908d2fafd652c16cb8c093a981eb679;p=fs%2Flustre-release.git diff --git a/build/commit-msg b/build/commit-msg index 02d704d..bb771b5 100755 --- a/build/commit-msg +++ b/build/commit-msg @@ -19,6 +19,7 @@ init() { readonly SAVE="$(basename $ORIGINAL).$(date +%Y%m%d.%H%M%S)" readonly SIGNOFF="Signed-off-by:" readonly CHANGEID="Change-Id:" + readonly TESTPARAMS="Test-Parameters:" readonly INNOCUOUS=$(echo \ Acked-by \ Tested-by \ @@ -41,7 +42,6 @@ init() { HAS_BODY=false HAS_SIGNOFF=false HAS_CHANGEID=false - HAS_DIFF=false IS_WRAPPING_UP=false @@ -135,7 +135,6 @@ function do_default_line() { HAS_BODY=true fi HAS_LAST_BLANK=false - HAS_DIFF=false } # Add a new unique Change-Id @@ -159,7 +158,7 @@ new_changeid() { # error() { (( ${#LINE} > 0 )) && echo "line $NUM: $LINE" - echo "error: commit message $*" | fmt --split-only + echo "error: commit message $*" | fmt HAS_ERROR=true } 1>&2 @@ -197,8 +196,11 @@ usage() { commit/submission. Copy the one from the original commit. The "sign off section" may also include several other tag lines: - $(for T in $(tr '|' ' ' <<< "$INNOCUOUS"); do echo " $T: "; done - {Organization}-bug-id: associated ticket identifier + $(for T in $(tr '|' ' ' <<< "$INNOCUOUS"); do \ + echo " $T: Some Person "; \ + done) + $TESTPARAMS optional additional test parameters + {Organization}-bug-id: associated external change identifier EOF mv "$ORIGINAL" "$SAVE" && @@ -213,6 +215,7 @@ while IFS= read -u3 LINE; do case "$LINE" in $SIGNOFF* ) do_signoff ;; $CHANGEID* ) do_changeid ;; + $TESTPARAMS* ) ck_wrapup ;; "") HAS_LAST_BLANK=true @@ -228,13 +231,18 @@ while IFS= read -u3 LINE; do # there are diff and index lines, skip the rest of the input: # diff --git a/build/commit-msg b/build/commit-msg # index 80a3442..acb4c50 100755 - # If a "diff --git" line is not followed by an index line, - # do the default line processing on both lines. + # deleted file mode 100644 + # old mode 100644 + # If a "diff --git" line is not followed by one of these + # lines, do the default line processing on both lines. # IFS= read -u3 INDEX || break ((NUM += 1)) - ln=$(echo "$INDEX" | grep "^index [0-9a-fA-F]\{6,\}\.\.") - (( ${#ln} > 1 )) && break + case "$INDEX" in + "index "[0-9a-fA-F]*) break ;; + "deleted file mode "*) break ;; + "old mode "*) break ;; + esac LINE=${LINE}$'\n'${INDEX} do_default_line ;; @@ -242,12 +250,12 @@ while IFS= read -u3 LINE; do *) if [[ "$LINE" =~ ^($INNOCUOUS): ]]; then do_innocuous - elif [[ "$LINE" =~ ^[A-Za-z0-9_-]+-bug-id: ]]; then - ck_wrapup - else - # Allow arbitrary external bug identifiers for tracking. - # I can't seem to find a pattern for the "case" that - # checks for "*-bug-id", so this is checked here. + elif [[ "$LINE" =~ ^[A-Za-z0-9_-]+-bug-id: ]]; then + ck_wrapup + else + # Allow arbitrary external bug identifiers for tracking. + # I can't seem to find a pattern for the "case" that + # checks for "*-bug-id", so this is checked here. do_default_line fi ;;