diff options
author | Junio C Hamano <junkio@cox.net> | 2005-08-31 17:15:25 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-08-31 17:15:25 -0700 |
commit | 2d56993347eac4e4f91c0539ff3c5f05fd777495 (patch) | |
tree | fd4b647b4d0cb3d68499c5ccfdcab17fccec16a5 | |
parent | 7e011c40bc6c7dbd48b033fb16c861b1166f808c (diff) | |
download | git-2d56993347eac4e4f91c0539ff3c5f05fd777495.tar.gz git-2d56993347eac4e4f91c0539ff3c5f05fd777495.tar.xz |
Use 'git status' now it can handle initial commit.
Update 'git commit' to use the updated `git status`. Also earlier
the `-s` flag was ignored for the initial commit.
Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-x | git-commit-script | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/git-commit-script b/git-commit-script index cd28dde64..a2455b0f8 100755 --- a/git-commit-script +++ b/git-commit-script @@ -113,21 +113,6 @@ t) fi esac -if [ ! -r "$GIT_DIR/HEAD" ] -then - echo "#" - echo "# Initial commit" - echo "#" - git-ls-files | sed 's/^/# New file: /' - echo "#" -elif [ -f "$GIT_DIR/MERGE_HEAD" ]; then - echo "#" - echo "# It looks like your may be committing a MERGE." - echo "# If this is not correct, please remove the file" - echo "# $GIT_DIR/MERGE_HEAD" - echo "# and try again" - echo "#" -fi >.editmsg if test "$log_message" != '' then echo "$log_message" @@ -144,7 +129,25 @@ then elif test "$use_commit" != "" then git-cat-file commit "$use_commit" | sed -e '1,/^$/d' -fi | git-stripspace >>.editmsg +fi | git-stripspace >.editmsg + +case "$signoff" in +t) + git-var GIT_COMMITTER_IDENT | sed -e ' + s/>.*/>/ + s/^/Signed-off-by: / + ' >>.editmsg + ;; +esac + +if [ -f "$GIT_DIR/MERGE_HEAD" ]; then + echo "#" + echo "# It looks like your may be committing a MERGE." + echo "# If this is not correct, please remove the file" + echo "# $GIT_DIR/MERGE_HEAD" + echo "# and try again" + echo "#" +fi >>.editmsg PARENTS="-p HEAD" if [ ! -r "$GIT_DIR/HEAD" ]; then @@ -186,16 +189,8 @@ else export GIT_AUTHOR_EMAIL export GIT_AUTHOR_DATE fi - case "$signoff" in - t) - git-var GIT_COMMITTER_IDENT | sed -e ' - s/>.*/>/ - s/^/Signed-off-by: / - ' >>.editmsg - ;; - esac - git-status-script >>.editmsg fi +git-status-script >>.editmsg if [ "$?" != "0" -a ! -f $GIT_DIR/MERGE_HEAD ] then rm -f .editmsg |