X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=git-commit-script;h=a2455b0f8ff1582248b0678b9c85b2f064d972c4;hb=2ab141a26f93c4d97e243a6be8a38a7dd4eb35a3;hp=4987e37861adac29af5bfd03a8d8e1e6932338e0;hpb=9804b7dc1974d59d4d37c37ba4624bb835456207;p=git.git diff --git a/git-commit-script b/git-commit-script index 4987e378..a2455b0f 100755 --- a/git-commit-script +++ b/git-commit-script @@ -64,6 +64,9 @@ do use_commit="$1" no_edit=t shift ;; + -e|--e|--ed|--edi|--edit) + no_edit= + shift ;; -s|--s|--si|--sig|--sign|--signo|--signof|--signoff) signoff=t shift ;; @@ -110,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" @@ -141,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 @@ -183,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