format-patch: correct documentation of --thread without an argument
In Git, almost all command line flags unconditionally override the corresponding config option.[1] Add a test to confirm that this is the case for `git format-patch --thread`. [1] https://lore.kernel.org/git/CAMMLpeS3+NUQa2oqpHKVo3yWQNVMgkEXrs4U5_ggvk31yQbezQ@mail.gmail.com/ Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alex Henrie committed
Apr 2, 2023 at 22:07 UTC
f024913164ae6ec53bd97c0fb8481abb0fecd86d
2 files changed
+6
-2
Documentation/git-format-patch.txt
+1
-2
@@ -173,8 +173,7 @@ series, where the head is chosen from the cover letter, the
173
threading makes every mail a reply to the previous one.
174
+
175
The default is `--no-thread`, unless the `format.thread` configuration
176
-is set. If `--thread` is specified without a style, it defaults to the
177
-style specified by `format.thread` if any, or else `shallow`.
176
+is set. `--thread` without an argument is equivalent to `--thread=shallow`.
177
+
178
Beware that the default for 'git send-email' is to thread emails
179
itself. If you want `git format-patch` to take care of threading, you
t/t4014-format-patch.sh
+5
@@ -470,6 +470,11 @@ test_expect_success 'thread' '
470
check_threading expect.thread --thread main
471
'
472
473
+test_expect_success '--thread overrides format.thread=deep' '
474
+ test_config format.thread deep &&
475
+ check_threading expect.thread --thread main
476
+'
477
+
478
cat >expect.in-reply-to <<EOF
479
---
480
Message-Id: <0>