format-patch: add format.coverLetter configuration variable
Also, add a new option: 'auto', so if there's more than one patch, the cover letter is generated, otherwise it's not. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
aa089cd9ab
commit
2a4c26076c
@ -1289,4 +1289,32 @@ test_expect_success 'cover letter with nothing' '
|
||||
test_line_count = 0 actual
|
||||
'
|
||||
|
||||
test_expect_success 'cover letter auto' '
|
||||
mkdir -p tmp &&
|
||||
test_when_finished "rm -rf tmp;
|
||||
git config --unset format.coverletter" &&
|
||||
|
||||
git config format.coverletter auto &&
|
||||
git format-patch -o tmp -1 >list &&
|
||||
test_line_count = 1 list &&
|
||||
git format-patch -o tmp -2 >list &&
|
||||
test_line_count = 3 list
|
||||
'
|
||||
|
||||
test_expect_success 'cover letter auto user override' '
|
||||
mkdir -p tmp &&
|
||||
test_when_finished "rm -rf tmp;
|
||||
git config --unset format.coverletter" &&
|
||||
|
||||
git config format.coverletter auto &&
|
||||
git format-patch -o tmp --cover-letter -1 >list &&
|
||||
test_line_count = 2 list &&
|
||||
git format-patch -o tmp --cover-letter -2 >list &&
|
||||
test_line_count = 3 list &&
|
||||
git format-patch -o tmp --no-cover-letter -1 >list &&
|
||||
test_line_count = 1 list &&
|
||||
git format-patch -o tmp --no-cover-letter -2 >list &&
|
||||
test_line_count = 2 list
|
||||
'
|
||||
|
||||
test_done
|
||||
|
Reference in New Issue
Block a user