diff mbox series

[v2,2/5] doc: document --recurse-submodules for reset and restore

Message ID 20200303170740.1879432-3-damien.olivier.robert+git@gmail.com (mailing list archive)
State New, archived
Headers show
Series doc: --recurse-submodules | expand

Commit Message

Damien Robert March 3, 2020, 5:07 p.m. UTC
Signed-off-by: Damien Robert <damien.olivier.robert+git@gmail.com>
---
 Documentation/git-reset.txt   |  6 ++++++
 Documentation/git-restore.txt | 10 ++++++++++
 2 files changed, 16 insertions(+)

Comments

Junio C Hamano March 3, 2020, 9:54 p.m. UTC | #1
Damien Robert <damien.olivier.robert@gmail.com> writes:

> +
> +--[no-]recurse-submodules::
> +	When the working tree is updated, using --recurse-submodules will
> +...
>  
> +--recurse-submodules::
> +--no-recurse-submodules::
> +	If `<pathspec>` names a submodule and the restore location includes
> +...

Hmph, this inconsistency across files is a bit unfortunate.  

I think (please somebody correct me from sideways) we have been
moving towards using the "--[no-]option-name", so we would want to
clean up the latter (together with the "--[no-]overlay" entry in the
same file, with which the above tries to be consistent) sometime
later when the dust settles, iow, not as a part of this series.

> +	is given, in which case it's working tree will be restored to the
> +	commit recorded in the superproject, and it's local modifications
> +	overwritten. If nothing (or `--no-recurse-submodules`) is used,
> +	the work trees of submodules 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
Philippe Blain March 6, 2020, 4:16 a.m. UTC | #2
> Le 3 mars 2020 à 12:07, Damien Robert <damien.olivier.robert@gmail.com> a écrit :
> 
> Signed-off-by: Damien Robert <damien.olivier.robert+git@gmail.com>
> ---
> Documentation/git-reset.txt   |  6 ++++++
> Documentation/git-restore.txt | 10 ++++++++++
> 2 files changed, 16 insertions(+)
> 
> diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
> index 932080c55d..838c0f1101 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 content of all active submodules
> +	according to the commit recorded in the superproject, also setting
> +	the submodules HEAD to be detached at that commit.
> —

Maybe "working tree" instead of "content" ?

> 
> 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..5036f91132 100644
> --- a/Documentation/git-restore.txt
> +++ b/Documentation/git-restore.txt
> @@ -107,6 +107,16 @@ in linkgit:git-checkout[1] for details.
> 	patterns and unconditionally restores any files in
> 	`<pathspec>`.
> 
> +--recurse-submodules::
> +--no-recurse-submodules::
> +	If `<pathspec>` names a submodule and the restore location includes
> +	the working tree, the submodule will only be updated if this option
> +	is given, in which case it's working tree will be restored to the
> +	commit recorded in the superproject, and it's local modifications
> +	overwritten. If nothing (or `--no-recurse-submodules`) is used,
> +	the work trees of submodules will not be updated. Just like
> +	linkgit:git-checkout[1], this will detach `HEAD` of the submodule.
> +

both "it's" should be "its". In fact I'd personally prefer "any local modifications" instead of "its local modifications"
diff mbox series

Patch

diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
index 932080c55d..838c0f1101 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 content of all active submodules
+	according to the commit recorded in the superproject, also setting
+	the submodules HEAD to be detached at that commit.
 --
 
 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..5036f91132 100644
--- a/Documentation/git-restore.txt
+++ b/Documentation/git-restore.txt
@@ -107,6 +107,16 @@  in linkgit:git-checkout[1] for details.
 	patterns and unconditionally restores any files in
 	`<pathspec>`.
 
+--recurse-submodules::
+--no-recurse-submodules::
+	If `<pathspec>` names a submodule and the restore location includes
+	the working tree, the submodule will only be updated if this option
+	is given, in which case it's working tree will be restored to the
+	commit recorded in the superproject, and it's local modifications
+	overwritten. If nothing (or `--no-recurse-submodules`) is used,
+	the work trees of submodules 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