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>
This commit is contained in:

committed by
Junio C Hamano

parent
5c283eb13c
commit
a567fdcb01
@ -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
|
||||
'
|
||||
|
||||
git format-patch --stdout HEAD~2 >patch0 &&
|
||||
test_no_numbered patch0
|
||||
test_expect_success 'multiple patch defaults to numbered' '
|
||||
|
||||
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
|
||||
|
||||
'
|
||||
|
||||
|
Reference in New Issue
Block a user