diff options
-rwxr-xr-x | git-hooks/commit-msg | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/git-hooks/commit-msg b/git-hooks/commit-msg index f8df4e2075f4..d784d6561130 100755 --- a/git-hooks/commit-msg +++ b/git-hooks/commit-msg @@ -100,12 +100,14 @@ add_ChangeId() { return fi - if grep -i '^Change-Id:' "$MSG" >/dev/null + id=`grep -i '^Change-Id:' "$MSG" | sed -e "s/.*://"` + temp_msg=`grep -v -i '^Change-Id:' "$MSG"` + echo "$temp_msg" > "$MSG" + + if test -z "$id" then - return + id=`_gen_ChangeId` fi - - id=`_gen_ChangeId` perl -e ' $MSG = shift; $id = shift; |