]> git.ipfire.org Git - thirdparty/git.git/commitdiff
format-patch: correct documentation of --thread without an argument
authorAlex Henrie <alexhenrie24@gmail.com>
Mon, 3 Apr 2023 04:07:24 +0000 (22:07 -0600)
committerJunio C Hamano <gitster@pobox.com>
Mon, 3 Apr 2023 16:59:20 +0000 (09:59 -0700)
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>
Documentation/git-format-patch.txt
t/t4014-format-patch.sh

index dfcc7da4c211706570cd1ce7e1fd8552fb8947d9..ed299e077d3f2be9136236ee815dd99b7ee91fc2 100644 (file)
@@ -173,8 +173,7 @@ series, where the head is chosen from the cover letter, the
 threading makes every mail a reply to the previous one.
 +
 The default is `--no-thread`, unless the `format.thread` configuration
-is set.  If `--thread` is specified without a style, it defaults to the
-style specified by `format.thread` if any, or else `shallow`.
+is set.  `--thread` without an argument is equivalent to `--thread=shallow`.
 +
 Beware that the default for 'git send-email' is to thread emails
 itself.  If you want `git format-patch` to take care of threading, you
index 8c3d06622ae29457bfc32c8ecee17e1cd2c2143c..b27a72f78a81b7bc438d552f625de1204fe43214 100755 (executable)
@@ -470,6 +470,11 @@ test_expect_success 'thread' '
        check_threading expect.thread --thread main
 '
 
+test_expect_success '--thread overrides format.thread=deep' '
+       test_config format.thread deep &&
+       check_threading expect.thread --thread main
+'
+
 cat >expect.in-reply-to <<EOF
 ---
 Message-Id: <0>