summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-10 19:12:57 -0800
committerJunio C Hamano <junkio@cox.net>2006-02-10 19:12:57 -0800
commit69c57a8d87c0e1db40c6afbaa71769e68009e6a4 (patch)
tree25de93295992cdf108dcaa4613fcd1b97438b8b9
parentb82b0082db43f902309787e561613550dd773838 (diff)
parent29e55cd5ad9e17d2ff8a1a37b7ee45d18d1e59d6 (diff)
downloadgit-69c57a8d87c0e1db40c6afbaa71769e68009e6a4.tar.gz
Merge branch 'master'
* master: Define GIT_(AUTHOR|COMMITTER)_(NAME|EMAIL) to known values. Merge branch 'lt/diff-tree' git-commit -v: have patch at the end.
-rwxr-xr-xgit-commit.sh45
-rwxr-xr-xt/test-lib.sh10
2 files changed, 24 insertions, 31 deletions
diff --git a/git-commit.sh b/git-commit.sh
index e6793bd67e..073ec81e14 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -87,24 +87,13 @@ run_status () {
if test -z "$initial_commit"
then
- if test -z "$verbose"
- then
- git-diff-index -M --cached --name-status \
- --diff-filter=MDTCRA HEAD |
- sed -e '
- s/\\/\\\\/g
- s/ /\\ /g
- ' |
- report "Updated but not checked in" "will commit"
- else
- if git-diff-index --cached -M -p --diff-filter=MDTCRA HEAD |
- grep .
- then
- false
- else
- true
- fi
- fi
+ git-diff-index -M --cached --name-status \
+ --diff-filter=MDTCRA HEAD |
+ sed -e '
+ s/\\/\\\\/g
+ s/ /\\ /g
+ ' |
+ report "Updated but not checked in" "will commit"
committable="$?"
else
echo '#
@@ -155,6 +144,11 @@ run_status () {
print "$_\n";
}
'
+
+ if test -n "$verbose"
+ then
+ git-diff-index --cached -M -p --diff-filter=MDTCRA HEAD
+ fi
case "$committable" in
0)
echo "nothing to commit"
@@ -578,10 +572,7 @@ else
PARENTS=""
fi
-{
- test -z "$verbose" || echo '---'
- run_status
-} >>"$GIT_DIR"/COMMIT_EDITMSG
+run_status >>"$GIT_DIR"/COMMIT_EDITMSG
if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" ]
then
rm -f "$GIT_DIR/COMMIT_EDITMSG"
@@ -612,11 +603,11 @@ t)
esac
sed -e '
- /^---$/{
- s///
- q
- }
- /^#/d
+ /^diff --git a\/.*/{
+ s///
+ q
+ }
+ /^#/d
' "$GIT_DIR"/COMMIT_EDITMSG |
git-stripspace >"$GIT_DIR"/COMMIT_MSG
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 7534a76208..7a58a86f96 100755
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -16,11 +16,11 @@ unset COMMIT_AUTHOR_EMAIL
unset COMMIT_AUTHOR_NAME
unset GIT_ALTERNATE_OBJECT_DIRECTORIES
unset GIT_AUTHOR_DATE
-unset GIT_AUTHOR_EMAIL
-unset GIT_AUTHOR_NAME
+GIT_AUTHOR_EMAIL=author@example.com
+GIT_AUTHOR_NAME='A U Thor'
unset GIT_COMMITTER_DATE
-unset GIT_COMMITTER_EMAIL
-unset GIT_COMMITTER_NAME
+GIT_COMMITTER_EMAIL=committer@example.com
+GIT_COMMITTER_NAME='C O Mitter'
unset GIT_DIFF_OPTS
unset GIT_DIR
unset GIT_EXTERNAL_DIFF
@@ -28,6 +28,8 @@ unset GIT_INDEX_FILE
unset GIT_OBJECT_DIRECTORY
unset SHA1_FILE_DIRECTORIES
unset SHA1_FILE_DIRECTORY
+export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME
+export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
# Each test should start with something like this, after copyright notices:
#