diff mbox series

[v2,3/6] doc: reset: unify <pathspec> description

Message ID f961a5155a5ec1590652ce7b5a549eead71930e1.1573055478.git.gitgitgadget@gmail.com (mailing list archive)
State New, archived
Headers show
Series Add --pathspec-from-file option for reset, commit | expand

Commit Message

John Passaro via GitGitGadget Nov. 6, 2019, 3:51 p.m. UTC
From: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>

Synchronize it to `git add`, which has a pretty good description.

Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
---
 Documentation/git-reset.txt | 20 +++++++++++---------
 builtin/reset.c             |  4 ++--
 2 files changed, 13 insertions(+), 11 deletions(-)

Comments

Junio C Hamano Nov. 19, 2019, 6:05 a.m. UTC | #1
"Alexandr Miloslavskiy via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> -'git reset' [-q] [<tree-ish>] [--] <paths>...
> -'git reset' (--patch | -p) [<tree-ish>] [--] [<paths>...]
> +'git reset' [-q] [<tree-ish>] [--] <pathspec>...
> +'git reset' (--patch | -p) [<tree-ish>] [--] [<pathspec>...]

Good.

> @@ -18,24 +18,26 @@ In the first and second form, copy entries from `<tree-ish>` to the index.
>  In the third form, set the current branch head (`HEAD`) to `<commit>`,
>  optionally modifying index and working tree to match.
>  The `<tree-ish>`/`<commit>` defaults to `HEAD` in all forms.
> +The <pathspec> is used to limit the paths affected by the operation
> +(see the entry for 'pathspec' in linkgit:gitglossary[7] for more details).

Good.

> -'git reset' [-q] [<tree-ish>] [--] <paths>...::
> -	This form resets the index entries for all `<paths>` to their
> +'git reset' [-q] [<tree-ish>] [--] <pathspec>...::
> +	This form resets the index entries for all `<pathspec>` to their

This is not so good.  The original pretended as if <paths> are the
exact pathnames, so it was sort-of OK for it to say "for all paths".
Since we are highlighting the fact that these are not pathnames but
the patterns to match pathnames, however, the description needs a
slight update to match, perhaps like

	ths form resets the index entries for all paths that match
	the `<pathspec>` to their...

>  	state at `<tree-ish>`.  (It does not affect the working tree or
>  	the current branch.)

Thanks.
Alexandr Miloslavskiy Nov. 19, 2019, 4:52 p.m. UTC | #2
On 19.11.2019 7:05, Junio C Hamano wrote:

>> -'git reset' [-q] [<tree-ish>] [--] <paths>...::
>> -	This form resets the index entries for all `<paths>` to their
>> +'git reset' [-q] [<tree-ish>] [--] <pathspec>...::
>> +	This form resets the index entries for all `<pathspec>` to their
> 
> This is not so good.  The original pretended as if <paths> are the
> exact pathnames, so it was sort-of OK for it to say "for all paths".
> Since we are highlighting the fact that these are not pathnames but
> the patterns to match pathnames, however, the description needs a
> slight update to match, perhaps like
> 
> 	ths form resets the index entries for all paths that match
> 	the `<pathspec>` to their...
> 
>>   	state at `<tree-ish>`.  (It does not affect the working tree or
>>   	the current branch.)

Yes, I wasn't paying enough attention.
Changed in V3, thanks!
diff mbox series

Patch

diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
index 97e0544d9e..f2ccb1426c 100644
--- a/Documentation/git-reset.txt
+++ b/Documentation/git-reset.txt
@@ -8,8 +8,8 @@  git-reset - Reset current HEAD to the specified state
 SYNOPSIS
 --------
 [verse]
-'git reset' [-q] [<tree-ish>] [--] <paths>...
-'git reset' (--patch | -p) [<tree-ish>] [--] [<paths>...]
+'git reset' [-q] [<tree-ish>] [--] <pathspec>...
+'git reset' (--patch | -p) [<tree-ish>] [--] [<pathspec>...]
 'git reset' [--soft | --mixed [-N] | --hard | --merge | --keep] [-q] [<commit>]
 
 DESCRIPTION
@@ -18,24 +18,26 @@  In the first and second form, copy entries from `<tree-ish>` to the index.
 In the third form, set the current branch head (`HEAD`) to `<commit>`,
 optionally modifying index and working tree to match.
 The `<tree-ish>`/`<commit>` defaults to `HEAD` in all forms.
+The <pathspec> is used to limit the paths affected by the operation
+(see the entry for 'pathspec' in linkgit:gitglossary[7] for more details).
 
-'git reset' [-q] [<tree-ish>] [--] <paths>...::
-	This form resets the index entries for all `<paths>` to their
+'git reset' [-q] [<tree-ish>] [--] <pathspec>...::
+	This form resets the index entries for all `<pathspec>` to their
 	state at `<tree-ish>`.  (It does not affect the working tree or
 	the current branch.)
 +
-This means that `git reset <paths>` is the opposite of `git add
-<paths>`. This command is equivalent to
-`git restore [--source=<tree-ish>] --staged <paths>...`.
+This means that `git reset <pathspec>` is the opposite of `git add
+<pathspec>`. This command is equivalent to
+`git restore [--source=<tree-ish>] --staged <pathspec>...`.
 +
-After running `git reset <paths>` to update the index entry, you can
+After running `git reset <pathspec>` to update the index entry, you can
 use linkgit:git-restore[1] to check the contents out of the index to
 the working tree. Alternatively, using linkgit:git-restore[1]
 and specifying a commit with `--source`, you
 can copy the contents of a path out of a commit to the index and to the
 working tree in one go.
 
-'git reset' (--patch | -p) [<tree-ish>] [--] [<paths>...]::
+'git reset' (--patch | -p) [<tree-ish>] [--] [<pathspec>...]::
 	Interactively select hunks in the difference between the index
 	and `<tree-ish>` (defaults to `HEAD`).  The chosen hunks are applied
 	in reverse to the index.
diff --git a/builtin/reset.c b/builtin/reset.c
index fdd572168b..9291c0fd72 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -30,8 +30,8 @@ 
 
 static const char * const git_reset_usage[] = {
 	N_("git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]"),
-	N_("git reset [-q] [<tree-ish>] [--] <paths>..."),
-	N_("git reset --patch [<tree-ish>] [--] [<paths>...]"),
+	N_("git reset [-q] [<tree-ish>] [--] <pathspec>..."),
+	N_("git reset --patch [<tree-ish>] [--] [<pathspec>...]"),
 	NULL
 };