git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v4 2/5] doc: document --recurse-submodules for reset and restore

From
Philippe Blain <levraiphilippeblain@gmail.com>
Date
Mar 29, 2020, 20:34 UTC
Message-ID
<F03FAA2F-EDFB-4497-A4E8-3AC267C779FC@gmail.com>
In-Reply-To
<20200325210943.339240-3-damien.olivier.robert+git@gmail.com>
> Le 25 mars 2020 à 17:09, Damien Robert <damien.olivier.robert@gmail.com> a écrit :
> 
> Also unify the formulation about --no-submodules
that should be '--no-recurse-submodules'
Show 38 quoted lines
> for checkout and
> switch, which we reuse for restore.
> 
> And correct the formulation about submodules' HEAD in read-tree, which
> we reuse in reset.
> 
> Signed-off-by: Damien Robert <damien.olivier.robert+git@gmail.com>
> ---
> Documentation/git-checkout.txt  |  2 +-
> Documentation/git-read-tree.txt |  2 +-
> Documentation/git-reset.txt     |  6 ++++++
> Documentation/git-restore.txt   | 11 +++++++++++
> Documentation/git-switch.txt    |  2 +-
> 5 files changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
> index c8fb995fa7..140bd3eabb 100644
> --- a/Documentation/git-checkout.txt
> +++ b/Documentation/git-checkout.txt
> @@ -296,7 +296,7 @@ Note that this option uses the no overlay mode by default (see also
> 	submodules according to the commit recorded in the superproject. If
> 	local modifications in a submodule would be overwritten the checkout
> 	will fail unless `-f` is used. If nothing (or `--no-recurse-submodules`)
> -	is used, the work trees of submodules will not be updated.
> +	is used, submodules working trees will not be updated.
> 	Just like linkgit:git-submodule[1], this will detach `HEAD` of the
> 	submodule.
> 
> diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt
> index da33f84f33..807cad4691 100644
> --- a/Documentation/git-read-tree.txt
> +++ b/Documentation/git-read-tree.txt
> @@ -118,7 +118,7 @@ OPTIONS
> --[no-]recurse-submodules::
> 	Using --recurse-submodules will update the content of all initialized
> 	submodules according to the commit recorded in the superproject by
> -	calling read-tree recursively, also setting the submodules HEAD to be
> +	calling read-tree recursively, also setting the submodules' HEADs to be
I've rethought about that and I think it should be "submodules' HEAD" (sorry!)
Show 17 quoted lines
> 	detached at that commit.
> 
> --no-sparse-checkout::
> diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
> index 932080c55d..d7a09f11a0 100644
> --- a/Documentation/git-reset.txt
> +++ b/Documentation/git-reset.txt
> @@ -87,6 +87,12 @@ but carries forward unmerged index entries.
> 	different between `<commit>` and `HEAD`.
> 	If a file that is different between `<commit>` and `HEAD` has local
> 	changes, reset is aborted.
> +
> +--[no-]recurse-submodules::
> +	When the working tree is updated, using --recurse-submodules will
> +	also recursively reset the working tree of all active submodules
> +	according to the commit recorded in the superproject, also setting
> +	the submodules' HEADs to be detached at that commit.
same here
Show 41 quoted lines
> --
> 
> See "Reset, restore and revert" in linkgit:git[1] for the differences
> diff --git a/Documentation/git-restore.txt b/Documentation/git-restore.txt
> index 5bf60d4943..8e3b339802 100644
> --- a/Documentation/git-restore.txt
> +++ b/Documentation/git-restore.txt
> @@ -107,6 +107,17 @@ in linkgit:git-checkout[1] for details.
> 	patterns and unconditionally restores any files in
> 	`<pathspec>`.
> 
> +--recurse-submodules::
> +--no-recurse-submodules::
> +	If `<pathspec>` names an active submodule and the restore location
> +	includes the working tree, the submodule will only be updated if
> +	this option is given, in which case its working tree will be
> +	restored to the commit recorded in the superproject, and any local
> +	modifications overwritten. If nothing (or
> +	`--no-recurse-submodules`) is used, submodules working trees will
> +	not be updated. Just like linkgit:git-checkout[1], this will detach
> +	`HEAD` of the submodule.
> +
> --overlay::
> --no-overlay::
> 	In overlay mode, the command never removes files when
> diff --git a/Documentation/git-switch.txt b/Documentation/git-switch.txt
> index 197900363b..79dbc9624d 100644
> --- a/Documentation/git-switch.txt
> +++ b/Documentation/git-switch.txt
> @@ -183,7 +183,7 @@ name, the guessing is aborted.  You can explicitly give a name with
> 	Using `--recurse-submodules` will update the content of all
> 	initialized submodules according to the commit recorded in the
> 	superproject. If nothing (or `--no-recurse-submodules`) is
> -	used, the work trees of submodules will not be updated. Just
> +	used, submodules working trees will not be updated. Just
> 	like linkgit:git-submodule[1], this will detach `HEAD` of the
> 	submodules.
> 
> -- 
> Patched on top of v2.26.0 (git version 2.25.2)
> 
Previous: Damien RobertNext: Damien Robert
Message 48 of 62 in “doc: --recurse-submodules”
  1. 0/4 doc: --recurse-submodulesDamien Robert, Feb 28, 2020
  2. 1/4 doc: list all commands affected by recurse.submoduleDamien Robert, Feb 28, 2020
  3. Philippe BlainMar 2, 2020
  4. Damien RobertMar 3, 2020
  5. 2/4 doc: document --recurse-submodules for reset and restoreDamien Robert, Feb 28, 2020
  6. Philippe BlainMar 2, 2020
  7. Damien RobertMar 3, 2020
  8. Philippe BlainMar 6, 2020
  9. 3/4 doc: explain how to deactivate recurse.submodule completelyDamien Robert, Feb 28, 2020
  10. Philippe BlainMar 2, 2020
  11. 4/4 doc: be more precise on (fetch|pull).recurseSubmodulesDamien Robert, Feb 28, 2020
  12. Philippe BlainMar 2, 2020
  13. Damien RobertFeb 28, 2020
  14. Philippe BlainMar 3, 2020
  15. Philippe BlainMar 2, 2020
  16. 0/5 doc: --recurse-submodulesDamien Robert, Mar 3, 2020
  17. 1/5 doc: list all commands affected by submodule.recurseDamien Robert, Mar 3, 2020
  18. 2/5 doc: document --recurse-submodules for reset and restoreDamien Robert, Mar 3, 2020
  19. Junio C HamanoMar 3, 2020
  20. Philippe BlainMar 6, 2020
  21. 3/5 doc: explain how to deactivate recurse.submodule completelyDamien Robert, Mar 3, 2020
  22. Junio C HamanoMar 3, 2020
  23. Robert P. J. DayMar 3, 2020
  24. Damien RobertMar 3, 2020
  25. Philippe BlainMar 6, 2020
  26. 4/5 doc: be more precise on (fetch|push).recurseSubmodulesDamien Robert, Mar 3, 2020
  27. Junio C HamanoMar 3, 2020
  28. Robert P. J. DayMar 3, 2020
  29. 5/5 doc: --recurse-submodules only apply to active submodulesDamien Robert, Mar 3, 2020
  30. Philippe BlainMar 6, 2020
  31. Damien RobertMar 20, 2020
  32. 0/5 doc: --recurse-submodulesDamien Robert, Mar 20, 2020
  33. 2/5 doc: document --recurse-submodules for reset and restoreDamien Robert, Mar 20, 2020
  34. Philippe BlainMar 22, 2020
  35. Damien RobertMar 25, 2020
  36. 3/5 doc: explain how to deactivate submodule.recurse completelyDamien Robert, Mar 20, 2020
  37. Philippe BlainMar 22, 2020
  38. 4/5 doc: be more precise on (fetch|push).recurseSubmodulesDamien Robert, Mar 20, 2020
  39. Philippe BlainMar 22, 2020
  40. Junio C HamanoMar 22, 2020
  41. Philippe BlainMar 22, 2020
  42. 5/5 doc: --recurse-submodules mostly only apply to active submodulesDamien Robert, Mar 20, 2020
  43. Philippe BlainMar 22, 2020
  44. 1/5 doc: list all commands affected by submodule.recurseDamien Robert, Mar 20, 2020
  45. 0/5 doc: --recurse-submodulesDamien Robert, Mar 25, 2020
  46. 1/5 doc: list all commands affected by submodule.recurseDamien Robert, Mar 25, 2020
  47. 2/5 doc: document --recurse-submodules for reset and restoreDamien Robert, Mar 25, 2020
  48. Philippe BlainMar 29, 2020
  49. 3/5 doc: explain how to deactivate submodule.recurse completelyDamien Robert, Mar 25, 2020
  50. 5/5 doc: --recurse-submodules mostly applies to active submodulesDamien Robert, Mar 25, 2020
  51. 4/5 doc: be more precise on (fetch|push).recurseSubmodulesDamien Robert, Mar 25, 2020
  52. Philippe BlainMar 29, 2020
  53. 0/5 doc: --recurse-submodulesDamien Robert, Apr 5, 2020
  54. 1/5 doc: list all commands affected by submodule.recurseDamien Robert, Apr 5, 2020
  55. 3/5 doc: explain how to deactivate submodule.recurse completelyDamien Robert, Apr 5, 2020
  56. 2/5 doc: document --recurse-submodules for reset and restoreDamien Robert, Apr 5, 2020
  57. 5/5 doc: --recurse-submodules mostly applies to active submodulesDamien Robert, Apr 5, 2020
  58. 4/5 doc: be more precise on (fetch|push).recurseSubmodulesDamien Robert, Apr 5, 2020
  59. Junio C HamanoApr 5, 2020
  60. Damien RobertApr 6, 2020
  61. Junio C HamanoApr 6, 2020
  62. Damien RobertApr 6, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.