Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-12-22 23:16:19 +0300
committerJunio C Hamano <gitster@pobox.com>2022-12-25 10:32:45 +0300
commit4810946f6032a973ad752d06a32437bc9bb35e67 (patch)
tree0b81441620ac67b4a99ff69c2217ec1700ac60e0 /t/t4014-format-patch.sh
parent7c2ef319c52c4997256f5807564523dfd4acdfc7 (diff)
format-patch: support format.mboxrd with --stdout
mboxrd is a more robust output format when used with --stdout and needs more exposure. Introducing this config knob lets users choose the more robust format for all their --stdout uses. Relying on --pretty=mboxrd and including all of pretty-formats.txt in the `git format-patch' documentation would likely be confusing to users. Furthermore, this setting is useful across multiple invocations. So introduce `format.mboxrd' as a boolean configuration knob that changes the default --pretty=email format to --pretty=mboxrd when (and only when) --stdout is in use. Signed-off-by: Eric Wong <e@80x24.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4014-format-patch.sh')
-rwxr-xr-xt/t4014-format-patch.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index de1da4673d..012f155e10 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -2281,7 +2281,7 @@ test_expect_success 'format-patch --attach cover-letter only is non-multipart' '
test_line_count = 1 output
'
-test_expect_success 'format-patch --pretty=mboxrd' '
+test_expect_success '-c format.mboxrd format-patch' '
sp=" " &&
cat >msg <<-INPUT_END &&
mboxrd should escape the body
@@ -2316,7 +2316,9 @@ test_expect_success 'format-patch --pretty=mboxrd' '
INPUT_END
C=$(git commit-tree HEAD^^{tree} -p HEAD <msg) &&
- git format-patch --pretty=mboxrd --stdout -1 $C~1..$C >patch &&
+ git -c format.mboxrd format-patch --stdout -1 $C~1..$C >patch &&
+ git format-patch --pretty=mboxrd --stdout -1 $C~1..$C >compat &&
+ test_cmp patch compat &&
git grep -h --no-index -A11 \
"^>From could trip up a loose mbox parser" patch >actual &&
test_cmp expect actual