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:
authorStephen Boyd <bebarino@gmail.com>2010-03-08 01:46:47 +0300
committerJunio C Hamano <gitster@pobox.com>2010-03-09 02:55:41 +0300
commitc42600346bb6c3427df7ea1c5a33d723ec02d731 (patch)
treef0780075f41a3a2943da114ed119420e8e0d50c2 /t/t4014-format-patch.sh
parentca9e0a1b8738959f5bd5a17ec81fa3bd1a326c9d (diff)
format-patch: add --no-cc, --no-to, and --no-add-headers
These new options allow users to override their config settings for format.cc, format.to and format.headers respectively. These options only make git ignore the config settings and any previous command line options, so you'll still have to add more command line options to add extra headers. For example, $ cat .git/config [format] to = Someone <someone@out.there> $ git format-patch -1 --no-to --to="Someone Else <else@out.there>" would format a patch addressed to "Someone Else" and not "Someone". Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4014-format-patch.sh')
-rwxr-xr-xt/t4014-format-patch.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 830ddb0cbe..c7b625642d 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -157,6 +157,44 @@ test_expect_success 'configuration To: header' '
grep "^To: R. E. Cipient <rcipient@example.com>\$" patch9
'
+test_expect_success '--no-to overrides config.to' '
+
+ git config --replace-all format.to \
+ "R. E. Cipient <rcipient@example.com>" &&
+ git format-patch --no-to --stdout master..side |
+ sed -e "/^\$/q" >patch10 &&
+ ! grep "^To: R. E. Cipient <rcipient@example.com>\$" patch10
+'
+
+test_expect_success '--no-to and --to replaces config.to' '
+
+ git config --replace-all format.to \
+ "Someone <someone@out.there>" &&
+ git format-patch --no-to --to="Someone Else <else@out.there>" \
+ --stdout master..side |
+ sed -e "/^\$/q" >patch11 &&
+ ! grep "^To: Someone <someone@out.there>\$" patch11 &&
+ grep "^To: Someone Else <else@out.there>\$" patch11
+'
+
+test_expect_success '--no-cc overrides config.cc' '
+
+ git config --replace-all format.cc \
+ "C. E. Cipient <rcipient@example.com>" &&
+ git format-patch --no-cc --stdout master..side |
+ sed -e "/^\$/q" >patch12 &&
+ ! grep "^Cc: C. E. Cipient <rcipient@example.com>\$" patch12
+'
+
+test_expect_success '--no-add-headers overrides config.headers' '
+
+ git config --replace-all format.headers \
+ "Header1: B. E. Cipient <rcipient@example.com>" &&
+ git format-patch --no-add-headers --stdout master..side |
+ sed -e "/^\$/q" >patch13 &&
+ ! grep "^Header1: B. E. Cipient <rcipient@example.com>\$" patch13
+'
+
test_expect_success 'multiple files' '
rm -rf patches/ &&