diff options
author | Johan Herland <johan@herland.net> | 2009-10-09 12:22:01 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-10-19 18:59:43 -0700 |
commit | d9246d4303f441c0e30614cd3a97a80fbe9354b6 (patch) | |
tree | 9222a4d701367e3be3027e2e0d4a3cfe6bd372eb /t/t3301-notes.sh | |
parent | a5b0c24f3e9a29f8fe496f49db82f2e3f1b687ce (diff) | |
download | git-d9246d4303f441c0e30614cd3a97a80fbe9354b6.tar.gz git-d9246d4303f441c0e30614cd3a97a80fbe9354b6.tar.xz |
Teach "-m <msg>" and "-F <file>" to "git notes edit"
The "-m" and "-F" options are already the established method
(in both git-commit and git-tag) to specify a commit/tag message
without invoking the editor. This patch teaches "git notes edit"
to respect the same options for specifying a notes message without
invoking the editor.
Multiple "-m" and/or "-F" options are concatenated as separate
paragraphs.
The patch also updates the "git notes" documentation and adds
selftests for the new functionality. Unfortunately, the added
selftests include a couple of lines with trailing whitespace
(without these the test will fail). This may cause git to warn
about "whitespace errors".
This patch has been improved by the following contributions:
- Thomas Rast: fix trailing whitespace in t3301
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3301-notes.sh')
-rwxr-xr-x | t/t3301-notes.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh index 73e53be40..1e34f4836 100755 --- a/t/t3301-notes.sh +++ b/t/t3301-notes.sh @@ -110,5 +110,41 @@ test_expect_success 'show multi-line notes' ' git log -2 > output && test_cmp expect-multiline output ' +test_expect_success 'create -m and -F notes (setup)' ' + : > a4 && + git add a4 && + test_tick && + git commit -m 4th && + echo "xyzzy" > note5 && + git notes edit -m spam -F note5 -m "foo +bar +baz" +' + +whitespace=" " +cat > expect-m-and-F << EOF +commit 15023535574ded8b1a89052b32673f84cf9582b8 +Author: A U Thor <author@example.com> +Date: Thu Apr 7 15:16:13 2005 -0700 + + 4th + +Notes: + spam +$whitespace + xyzzy +$whitespace + foo + bar + baz +EOF + +printf "\n" >> expect-m-and-F +cat expect-multiline >> expect-m-and-F + +test_expect_success 'show -m and -F notes' ' + git log -3 > output && + test_cmp expect-m-and-F output +' test_done |