summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Melchiorsen <mail@cup.kalibalik.dk>2008-07-29 20:12:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-07-30 07:00:02 (GMT)
commitbd2574ca69331d33429f8806ce189b2941e490e7 (patch)
tree9d85e026114bc526c690bde46879bb538781b717
parentae7c5dcef92d46cfc8987fde2c264614fe475bd1 (diff)
downloadgit-bd2574ca69331d33429f8806ce189b2941e490e7.zip
git-bd2574ca69331d33429f8806ce189b2941e490e7.tar.gz
git-bd2574ca69331d33429f8806ce189b2941e490e7.tar.bz2
Advertise the ability to abort a commit
This treats aborting a commit more like a feature. Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin-commit.c1
-rwxr-xr-xt/t7502-commit.sh7
2 files changed, 5 insertions, 3 deletions
diff --git a/builtin-commit.c b/builtin-commit.c
index 9a11ca0..f7c053a 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -555,6 +555,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
fprintf(fp,
"\n"
"# Please enter the commit message for your changes.\n"
+ "# To abort the commit, use an empty commit message.\n"
"# (Comment lines starting with '#' will ");
if (cleanup_mode == CLEANUP_ALL)
fprintf(fp, "not be included)\n");
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 4f2682e..f111263 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -142,6 +142,7 @@ test_expect_success 'cleanup commit messages (strip,-F)' '
echo "sample
# Please enter the commit message for your changes.
+# To abort the commit, use an empty commit message.
# (Comment lines starting with '#' will not be included)" >expect
test_expect_success 'cleanup commit messages (strip,-F,-e)' '
@@ -149,7 +150,7 @@ test_expect_success 'cleanup commit messages (strip,-F,-e)' '
echo >>negative &&
{ echo;echo sample;echo; } >text &&
git commit -e -F text -a &&
- head -n 4 .git/COMMIT_EDITMSG >actual &&
+ head -n 5 .git/COMMIT_EDITMSG >actual &&
test_cmp expect actual
'
@@ -162,7 +163,7 @@ test_expect_success 'author different from committer' '
echo >>negative &&
git commit -e -m "sample"
- head -n 7 .git/COMMIT_EDITMSG >actual &&
+ head -n 8 .git/COMMIT_EDITMSG >actual &&
test_cmp expect actual
'
@@ -181,7 +182,7 @@ test_expect_success 'committer is automatic' '
# must fail because there is no change
test_must_fail git commit -e -m "sample"
) &&
- head -n 8 .git/COMMIT_EDITMSG | \
+ head -n 9 .git/COMMIT_EDITMSG | \
sed "s/^# Committer: .*/# Committer:/" >actual &&
test_cmp expect actual
'