Whamcloud - gitweb
LU-2961 build: Fix commit-msg to love new files
authorLi Wei <wei.g.li@intel.com>
Thu, 14 Mar 2013 07:54:16 +0000 (15:54 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 22 Mar 2013 18:25:13 +0000 (14:25 -0400)
It is annoying to receive errors like this when the changes being
committed include new files:

  $ git commit -asv --amend
  line 65: diff --git a/lustre/include/lustre_errno.h
  b/lustre/include/lustre_errno.h
  new file mode 100644
  error: commit message invalid signoff section line
  line 66: index 0000000..89b8d1b
  error: commit message invalid signoff section line
  line 67: --- /dev/null
  error: commit message invalid signoff section line
  ...

This patch adds the "new file mode" pattern to commit-msg.  Hopefully,
this is enough.

Signed-off-by: Li Wei <wei.g.li@intel.com>
Change-Id: I39c985d51afb04184322a8fc725bcef3938bf419
Reviewed-on: http://review.whamcloud.com/5712
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Hudson
Reviewed-by: Bruce Korb <bruce_korb@xyratex.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
build/commit-msg

index 0710645..e0803ea 100755 (executable)
@@ -242,6 +242,7 @@ while IFS= read -u3 LINE; do
                 "index "[0-9a-fA-F]*) break ;;
                 "deleted file mode "*) break  ;;
                 "old mode "*) break ;;
+               "new file mode "*) break ;;
                 esac
                 LINE=${LINE}$'\n'${INDEX}
                 do_default_line