X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-commit.sh;h=4cf3fab05cd3c3367173c86a65665ddfc1d89805;hb=3cd4f5e8eb04ae01298ceaf46bb41a4277031916;hp=08d786db2f3ea47503b798dec35d412cd9b22d4f;hpb=4f12d529abbf233e1df93e7ffa5f2719005a2258;p=git.git diff --git a/git-commit.sh b/git-commit.sh index 08d786db2..4cf3fab05 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -138,32 +138,26 @@ run_status () { if test -z "$untracked_files"; then option="--directory --no-empty-directory" fi + hdr_shown= if test -f "$GIT_DIR/info/exclude" then - git-ls-files -z --others $option \ + git-ls-files --others $option \ --exclude-from="$GIT_DIR/info/exclude" \ --exclude-per-directory=.gitignore else - git-ls-files -z --others $option \ + git-ls-files --others $option \ --exclude-per-directory=.gitignore fi | - @@PERL@@ -e '$/ = "\0"; - my $shown = 0; - while (<>) { - chomp; - s|\\|\\\\|g; - s|\t|\\t|g; - s|\n|\\n|g; - s/^/# /; - if (!$shown) { - print "#\n# Untracked files:\n"; - print "# (use \"git add\" to add to commit)\n"; - print "#\n"; - $shown = 1; - } - print "$_\n"; - } - ' + while read line; do + if [ -z "$hdr_shown" ]; then + echo '#' + echo '# Untracked files:' + echo '# (use "git add" to add to commit)' + echo '#' + hdr_shown=1 + fi + echo "# $line" + done if test -n "$verbose" -a -z "$IS_INITIAL" then @@ -599,7 +593,7 @@ then GIT_AUTHOR_EMAIL=`expr "z$force_author" : '.*\(<.*\)'` && test '' != "$GIT_AUTHOR_NAME" && test '' != "$GIT_AUTHOR_EMAIL" || - die "malformatted --author parameter" + die "malformed --author parameter" export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL elif test '' != "$use_commit" then @@ -635,9 +629,12 @@ fi PARENTS="-p HEAD" if test -z "$initial_commit" then + rloga='commit' if [ -f "$GIT_DIR/MERGE_HEAD" ]; then + rloga='commit (merge)' PARENTS="-p HEAD "`sed -e 's/^/-p /' "$GIT_DIR/MERGE_HEAD"` elif test -n "$amend"; then + rloga='commit (amend)' PARENTS=$(git-cat-file commit HEAD | sed -n -e '/^$/q' -e 's/^parent /-p /p') fi @@ -649,6 +646,7 @@ else fi PARENTS="" current= + rloga='commit (initial)' fi if test -z "$no_edit" @@ -724,7 +722,7 @@ then fi && commit=$(cat "$GIT_DIR"/COMMIT_MSG | git-commit-tree $tree $PARENTS) && rlogm=$(sed -e 1q "$GIT_DIR"/COMMIT_MSG) && - git-update-ref -m "commit: $rlogm" HEAD $commit $current && + git-update-ref -m "$rloga: $rlogm" HEAD $commit $current && rm -f -- "$GIT_DIR/MERGE_HEAD" && if test -f "$NEXT_INDEX" then