{"thread":{"id":"57966","subject":"[PATCH] config: document and test the 'worktree' scope","startedAt":"2022-06-08T00:33:50Z","lastAt":"2022-06-08T04:06:43Z","messageCount":2,"participants":["Glen Choo via GitGitGadget","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"456833","messageId":"pull.1274.git.git.1654637044966.gitgitgadget@gmail.com","threadId":"57966","inReplyTo":null,"subject":"[PATCH] config: document and test the 'worktree' scope","fromName":"Glen Choo via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-06-07T21:24:04Z","receivedAt":"2022-06-08T00:33:50Z","isPatch":true,"sender":{"key":"glencbz@gmail.com","avatar":"https://avatars.githubusercontent.com/u/58092771?v=4"},"body":"From: Glen Choo <chooglen@google.com>\n\nTest that \"git config --show-scope\" shows the \"worktree\" scope, and add\nit to the list of scopes in Documentation/git-config.txt.\n\n\"git config --help\" does not need to be updated because it already\nmentions \"worktree\".\n\nSigned-off-by: Glen Choo <chooglen@google.com>\n---\n    config: document and test the 'worktree' scope\n    \n    While I was digging through the docs on config scopes for\n    discovery.bare, I noticed that Documentation/git-config.txt doesn't\n    mention the 'worktree' scope, but the usage string does.\n    \n    One might assume that since we have CONFIG_SCOPE_WORKTREE, the omission\n    from Documentation/git-config.txt is obviously accidental. But, when we\n    first added \"--show-scope\" in 145d59f (config: add '--show-scope' to\n    print the scope of a config value, 2020-02-10), we noted that\n    'submodule' would never be output from \"--show-scope\", even though\n    CONFIG_SCOPE_SUBMODULE exists.\n    \n    This patch adds a test that shows \"git config -l --show-scope\" can\n    indeed output 'worktree', and adds the 'worktree' scope to\n    Documentation/git-config.txt.\n    \n    This does not conflict with gc/bare-repo-discovery.\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1274%2Fchooglen%2Fdocument-worktree-scope-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1274/chooglen/document-worktree-scope-v1\nPull-Request: https://github.com/git/git/pull/1274\n\n Documentation/git-config.txt | 2 +-\n t/t1300-config.sh            | 9 +++++++++\n 2 files changed, 10 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-config.txt b/Documentation/git-config.txt\nindex bdcfd94b642..9376e39aef2 100644\n--- a/Documentation/git-config.txt\n+++ b/Documentation/git-config.txt\n@@ -248,7 +248,7 @@ Valid `<type>`'s include:\n --show-scope::\n \tSimilar to `--show-origin` in that it augments the output of\n \tall queried config options with the scope of that value\n-\t(local, global, system, command).\n+\t(worktree, local, global, system, command).\n \n --get-colorbool <name> [<stdout-is-tty>]::\n \ndiff --git a/t/t1300-config.sh b/t/t1300-config.sh\nindex 7dd9b325d90..d3d9adbb3db 100755\n--- a/t/t1300-config.sh\n+++ b/t/t1300-config.sh\n@@ -2024,8 +2024,17 @@ test_expect_success '--show-scope with --list' '\n \tlocal\tuser.override=local\n \tlocal\tinclude.path=../include/relative.include\n \tlocal\tuser.relative=include\n+\tlocal\tcore.repositoryformatversion=1\n+\tlocal\textensions.worktreeconfig=true\n+\tworktree\tuser.worktree=true\n \tcommand\tuser.cmdline=true\n \tEOF\n+\tgit worktree add wt1 &&\n+\t# We need these to test for worktree scope, but outside of this\n+\t# test, this is just noise\n+\ttest_config core.repositoryformatversion 1 &&\n+\ttest_config extensions.worktreeConfig true &&\n+\tgit config --worktree user.worktree true &&\n \tgit -c user.cmdline=true config --list --show-scope >output &&\n \ttest_cmp expect output\n '\n\nbase-commit: ab336e8f1c8009c8b1aab8deb592148e69217085\n-- \ngitgitgadget\n"},{"id":"456855","messageId":"xmqqsfogrm75.fsf@gitster.g","threadId":"57966","inReplyTo":"pull.1274.git.git.1654637044966.gitgitgadget@gmail.com","subject":"Re: [PATCH] config: document and test the 'worktree' scope","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-06-08T01:14:06Z","receivedAt":"2022-06-08T04:06:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Glen Choo via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: Glen Choo <chooglen@google.com>\n>\n> Test that \"git config --show-scope\" shows the \"worktree\" scope, and add\n> it to the list of scopes in Documentation/git-config.txt.\n>\n> \"git config --help\" does not need to be updated because it already\n> mentions \"worktree\".\n>\n> Signed-off-by: Glen Choo <chooglen@google.com>\n> ---\n>     config: document and test the 'worktree' scope\n>     \n>     While I was digging through the docs on config scopes for\n>     discovery.bare, I noticed that Documentation/git-config.txt doesn't\n>     mention the 'worktree' scope, but the usage string does.\n\nExcellent.\n\nThanks, will queue.\n"}]}