summaryrefslogtreecommitdiff
path: root/t/t4021-format-patch-numbered.sh
diff options
context:
space:
mode:
authorBrian Gernhardt <benji@silverinsanity.com>2008-10-02 16:55:39 -0400
committerJunio C Hamano <gitster@pobox.com>2008-10-18 07:18:03 -0700
commita567fdcb016e8e882ec0a1e044c9caac8f70e693 (patch)
treef88049a47c7d2355574599e0beb49de7d47d9d6a /t/t4021-format-patch-numbered.sh
parent5c283eb13c94be6ca974aa722159dc9838d10d97 (diff)
downloadgit-a567fdcb016e8e882ec0a1e044c9caac8f70e693.tar.gz
format-patch: autonumber by default
format-patch is most commonly used for multiple patches at once when sending a patchset, in which case we want to number the patches; on the other hand, single patches are not usually expected to be numbered. In other words, the typical behavior expected from format-patch is the one obtained by enabling autonumber, so we set it to be the default. Users that want to disable numbering for a particular patchset can do so with the existing -N command-line switch. Users that want to change the default behavior can use the format.numbering config key. Signed-off-by: Brian Gernhardt <benji@silverinsanity.com> Test-updates-by: Jeff King <peff@peff.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4021-format-patch-numbered.sh')
-rwxr-xr-xt/t4021-format-patch-numbered.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/t/t4021-format-patch-numbered.sh b/t/t4021-format-patch-numbered.sh
index 43d64bbd82..390af2389f 100755
--- a/t/t4021-format-patch-numbered.sh
+++ b/t/t4021-format-patch-numbered.sh
@@ -45,17 +45,22 @@ test_numbered() {
grep "^Subject: \[PATCH 2/2\]" $1
}
-test_expect_success 'Default: no numbered' '
+test_expect_success 'single patch defaults to no numbers' '
+ git format-patch --stdout HEAD~1 >patch0.single &&
+ test_single_no_numbered patch0.single
+'
+
+test_expect_success 'multiple patch defaults to numbered' '
- git format-patch --stdout HEAD~2 >patch0 &&
- test_no_numbered patch0
+ git format-patch --stdout HEAD~2 >patch0.multiple &&
+ test_numbered patch0.multiple
'
test_expect_success 'Use --numbered' '
- git format-patch --numbered --stdout HEAD~2 >patch1 &&
- test_numbered patch1
+ git format-patch --numbered --stdout HEAD~1 >patch1 &&
+ test_single_numbered patch1
'