From 99d0b829c7b376b1ff562a5782e24df47747bb65 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 14 Nov 2022 09:41:14 +0000 Subject: format-patch: add --mboxrd alias for --pretty=mboxrd mboxrd is a superior output format when used with --stdout and needs more exposure. Including pretty-formats.txt would be excessive, since documenting --pretty= for `git format-patch' would likely be confusing to users. Instead of documenting --pretty, add an --mboxrd alias to save keystrokes and improve documentation. Signed-off-by: Eric Wong Signed-off-by: Taylor Blau --- t/t4014-format-patch.sh | 6 ++++-- t/t4150-am.sh | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 't') diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index de1da4673d..69ed8b1ffa 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 'format-patch --mboxrd' ' 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 patch && + git format-patch --mboxrd --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 diff --git a/t/t4150-am.sh b/t/t4150-am.sh index cdad4b6880..9a128c16a6 100755 --- a/t/t4150-am.sh +++ b/t/t4150-am.sh @@ -1033,7 +1033,7 @@ test_expect_success 'am --patch-format=mboxrd handles mboxrd' ' >From extra escape for reversibility INPUT_END git commit -F msg && - git format-patch --pretty=mboxrd --stdout -1 >mboxrd1 && + git format-patch --mboxrd --stdout -1 >mboxrd1 && grep "^>From could trip up a loose mbox parser" mboxrd1 && git checkout -f first && git am --patch-format=mboxrd mboxrd1 && -- cgit v1.2.1