]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-commit.sh
War on whitespace
[thirdparty/git.git] / git-commit.sh
index 9e0959aec06c4d4d7b4f14660c26bc9dd941f111..5547a02954b23425e644d0b30ae6047afa393ac0 100755 (executable)
@@ -376,12 +376,12 @@ t,)
                        rm -f "$TMP_INDEX"
                fi || exit
 
-               echo "$commit_only" |
+               printf '%s\n' "$commit_only" |
                GIT_INDEX_FILE="$TMP_INDEX" \
                git-update-index --add --remove --stdin &&
 
                save_index &&
-               echo "$commit_only" |
+               printf '%s\n' "$commit_only" |
                (
                        GIT_INDEX_FILE="$NEXT_INDEX"
                        export GIT_INDEX_FILE
@@ -432,7 +432,7 @@ fi
 
 if test "$log_message" != ''
 then
-       echo "$log_message"
+       printf '%s\n' "$log_message"
 elif test "$logfile" != ""
 then
        if test "$logfile" = -
@@ -475,7 +475,7 @@ if test -f "$GIT_DIR/MERGE_HEAD" && test -z "$no_edit"; then
        echo "#"
        echo "# It looks like you may be committing a MERGE."
        echo "# If this is not correct, please remove the file"
-       echo "# $GIT_DIR/MERGE_HEAD"
+       printf '%s\n' "#        $GIT_DIR/MERGE_HEAD"
        echo "# and try again"
        echo "#"
 fi >>"$GIT_DIR"/COMMIT_EDITMSG
@@ -557,7 +557,7 @@ then
        } >>"$GIT_DIR"/COMMIT_EDITMSG
 else
        # we need to check if there is anything to commit
-       run_status >/dev/null 
+       run_status >/dev/null
 fi
 if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" -a -z "$amend" ]
 then
@@ -649,8 +649,9 @@ then
        fi
        if test -z "$quiet"
        then
+               commit=`git-diff-tree --always --shortstat --pretty="format:%h: %s"\
+                      --summary --root HEAD --`
                echo "Created${initial_commit:+ initial} commit $commit"
-               git-diff-tree --shortstat --summary --root --no-commit-id HEAD --
        fi
 fi