{"thread":{"id":"54340","subject":"[PATCH] gitsubmodules: add '--recurse-submodules' for 'ls-files'","startedAt":"2020-10-04T01:17:43Z","lastAt":"2020-10-04T19:55:48Z","messageCount":2,"participants":["Philippe Blain via GitGitGadget","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"406877","messageId":"pull.861.git.git.1601774257696.gitgitgadget@gmail.com","threadId":"54340","inReplyTo":null,"subject":"[PATCH] gitsubmodules: add '--recurse-submodules' for 'ls-files'","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-10-04T01:17:37Z","receivedAt":"2020-10-04T01:17:43Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"From: Philippe Blain <levraiphilippeblain@gmail.com>\n\n`git ls-files` was never taught to respect the `submodule.recurse`\nconfiguration variable, and it seems it is too late now to change that\n[1], but still the command is mentioned in 'gitsubmodules(7)' as if it\ndoes respect that config.\n\nAdjust the call in 'gitsubmodules(7)' by adding the\n'--recurse-submodules' flag.\n\nWhile at it, uniformize the capitalization in that file, and use\nbackticks instead of quotes for Git commands and configuration\nvariables.\n\n[1] https://lore.kernel.org/git/pull.732.git.1599707259907.gitgitgadget@gmail.com/T/#u\n\nSigned-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n---\n    gitsubmodules: add '--recurse-submodules' for 'ls-files'\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-861%2Fphil-blain%2Fgitsubmodules-ls-files-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-861/phil-blain/gitsubmodules-ls-files-v1\nPull-Request: https://github.com/git/git/pull/861\n\n Documentation/gitsubmodules.txt | 23 +++++++++++++----------\n 1 file changed, 13 insertions(+), 10 deletions(-)\n\ndiff --git a/Documentation/gitsubmodules.txt b/Documentation/gitsubmodules.txt\nindex f9f4e65c9e..891c8da4fd 100644\n--- a/Documentation/gitsubmodules.txt\n+++ b/Documentation/gitsubmodules.txt\n@@ -225,10 +225,10 @@ presence of the .url field.\n Workflow for a third party library\n ----------------------------------\n \n-  # add a submodule\n+  # Add a submodule\n   git submodule add <url> <path>\n \n-  # occasionally update the submodule to a new version:\n+  # Occasionally update the submodule to a new version:\n   git -C <path> checkout <new version>\n   git add <path>\n   git commit -m \"update submodule to new version\"\n@@ -246,20 +246,23 @@ Workflow for an artificially split repo\n   # regular commands recurse into submodules by default\n   git config --global submodule.recurse true\n \n-  # Unlike the other commands below clone still needs\n+  # Unlike most other commands below, clone still needs\n   # its own recurse flag:\n   git clone --recurse <URL> <directory>\n   cd <directory>\n \n   # Get to know the code:\n   git grep foo\n-  git ls-files\n+  git ls-files --recurse-submodules\n+\n+[NOTE]\n+`git ls-files` also requires its own `--recurse-submodules` flag.\n \n   # Get new code\n   git fetch\n   git pull --rebase\n \n-  # change worktree\n+  # Change worktree\n   git checkout\n   git reset\n \n@@ -267,12 +270,12 @@ Implementation details\n ----------------------\n \n When cloning or pulling a repository containing submodules the submodules\n-will not be checked out by default; You can instruct 'clone' to recurse\n-into submodules. The 'init' and 'update' subcommands of 'git submodule'\n+will not be checked out by default; you can instruct `clone` to recurse\n+into submodules. The `init` and `update` subcommands of `git submodule`\n will maintain submodules checked out and at an appropriate revision in\n-your working tree. Alternatively you can set 'submodule.recurse' to have\n-'checkout' recursing into submodules (note that 'submodule.recurse' also\n-affects other git commands, see linkgit:git-config[1] for a complete list).\n+your working tree. Alternatively you can set `submodule.recurse` to have\n+`checkout` recursing into submodules (note that `submodule.recurse` also\n+affects other Git commands, see linkgit:git-config[1] for a complete list).\n \n \n SEE ALSO\n\nbase-commit: 306ee63a703ad67c54ba1209dc11dd9ea500dc1f\n-- \ngitgitgadget\n"},{"id":"406889","messageId":"xmqqo8lh7olc.fsf@gitster.c.googlers.com","threadId":"54340","inReplyTo":"pull.861.git.git.1601774257696.gitgitgadget@gmail.com","subject":"Re: [PATCH] gitsubmodules: add '--recurse-submodules' for 'ls-files'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-10-04T19:55:43Z","receivedAt":"2020-10-04T19:55:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Philippe Blain via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> @@ -246,20 +246,23 @@ Workflow for an artificially split repo\n>    # regular commands recurse into submodules by default\n>    git config --global submodule.recurse true\n>  \n> -  # Unlike the other commands below clone still needs\n> +  # Unlike most other commands below, clone still needs\n>    # its own recurse flag:\n>    git clone --recurse <URL> <directory>\n>    cd <directory>\n>  \n>    # Get to know the code:\n>    git grep foo\n> -  git ls-files\n> +  git ls-files --recurse-submodules\n> +\n> +[NOTE]\n> +`git ls-files` also requires its own `--recurse-submodules` flag.\n\nMakes sense.  Thanks, will queue.\n"}]}