# [PATCH] doc: restore: remove note on --patch w/ pathspecs

6 messages from 2023-05-05 to 2025-03-17. Participants: Adam Johnson via GitGitGadget, Adam Johnson, Junio C Hamano, Johannes Schindelin.
Thread: https://gitlist.dev/t/59697

## Adam Johnson via GitGitGadget, 2023-05-05 10:32

Subject: [PATCH] doc: restore: remove note on --patch w/ pathspecs
Message-ID: <pull.1504.git.git.1683282753768.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/pull.1504.git.git.1683282753768.gitgitgadget%40gmail.com

```
From: Adam Johnson <me@adamj.eu>

This note was added with the command in 46e91b663b (checkout: split part of
it to new command 'restore', 2019-04-25), but it is now inaccurate. The
underlying builtin `add -i` implementation, made default in 0527ccb1b5 (add
-i: default to the built-in implementation, 2021-11-30), supports pathspecs,
so `git restore -p <pathspec>...` has worked for all users since then. I
bisected to verify this was the commit that added support.

Signed-off-by: Adam Johnson <me@adamj.eu>
---
    doc: restore: remove note on --patch w/ pathspecs
    
    This note was added with the command in 46e91b663b, but it is now
    inaccurate. The underlying builtin add -i implementation, made default
    in 0527ccb1b5, does support pathspecs, so git restore -p <pathspec>...
    has worked for all users since then. I bisected to verify this.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1504%2Fadamchainz%2Faj%2Fgit-restore-patch-docs-fix-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1504/adamchainz/aj/git-restore-patch-docs-fix-v1
Pull-Request: https://github.com/git/git/pull/1504

 Documentation/git-restore.txt | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/Documentation/git-restore.txt b/Documentation/git-restore.txt
index 5964810caa4..d31a06a673e 100644
--- a/Documentation/git-restore.txt
+++ b/Documentation/git-restore.txt
@@ -51,9 +51,6 @@ leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
 	restore source and the restore location. See the ``Interactive
 	Mode'' section of linkgit:git-add[1] to learn how to operate
 	the `--patch` mode.
-+
-Note that `--patch` can accept no pathspec and will prompt to restore
-all modified paths.
 
 -W::
 --worktree::

base-commit: f285f68a132109c234d93490671c00218066ace9
-- 
gitgitgadget

```

## Adam Johnson, 2023-05-25 07:25

Subject: Re: [PATCH] doc: restore: remove note on --patch w/ pathspecs
Message-ID: <CAMyDDM2iwpXkZOBB+9wLDwbcu-_KzEmDvXhSwnXXaHN+KNOieQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAMyDDM2iwpXkZOBB%2B9wLDwbcu-_KzEmDvXhSwnXXaHN%2BKNOieQ%40mail.gmail.com
In-Reply-To: <pull.1504.git.git.1683282753768.gitgitgadget@gmail.com>

```
Hi, is there anything I can do to help with review?


On Fri, May 5, 2023 at 11:32 AM Adam Johnson via GitGitGadget
<gitgitgadget@gmail.com> wrote:
>
> From: Adam Johnson <me@adamj.eu>
>
> This note was added with the command in 46e91b663b (checkout: split part of
> it to new command 'restore', 2019-04-25), but it is now inaccurate. The
> underlying builtin `add -i` implementation, made default in 0527ccb1b5 (add
> -i: default to the built-in implementation, 2021-11-30), supports pathspecs,
> so `git restore -p <pathspec>...` has worked for all users since then. I
> bisected to verify this was the commit that added support.
>
> Signed-off-by: Adam Johnson <me@adamj.eu>
> ---
>     doc: restore: remove note on --patch w/ pathspecs
>
>     This note was added with the command in 46e91b663b, but it is now
>     inaccurate. The underlying builtin add -i implementation, made default
>     in 0527ccb1b5, does support pathspecs, so git restore -p <pathspec>...
>     has worked for all users since then. I bisected to verify this.
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1504%2Fadamchainz%2Faj%2Fgit-restore-patch-docs-fix-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1504/adamchainz/aj/git-restore-patch-docs-fix-v1
> Pull-Request: https://github.com/git/git/pull/1504
>
>  Documentation/git-restore.txt | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/Documentation/git-restore.txt b/Documentation/git-restore.txt
> index 5964810caa4..d31a06a673e 100644
> --- a/Documentation/git-restore.txt
> +++ b/Documentation/git-restore.txt
> @@ -51,9 +51,6 @@ leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
>         restore source and the restore location. See the ``Interactive
>         Mode'' section of linkgit:git-add[1] to learn how to operate
>         the `--patch` mode.
> -+
> -Note that `--patch` can accept no pathspec and will prompt to restore
> -all modified paths.
>
>  -W::
>  --worktree::
>
> base-commit: f285f68a132109c234d93490671c00218066ace9
> --
> gitgitgadget

```

## Junio C Hamano, 2023-06-01 05:09

Subject: Re: [PATCH] doc: restore: remove note on --patch w/ pathspecs
Message-ID: <xmqq5y87epjw.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqq5y87epjw.fsf%40gitster.g
In-Reply-To: <CAMyDDM2iwpXkZOBB+9wLDwbcu-_KzEmDvXhSwnXXaHN+KNOieQ@mail.gmail.com>

```
Adam Johnson <me@adamj.eu> writes:

> Hi, is there anything I can do to help with review?

One good thing you can do is to ping like you did ;-)

I have been down/sick and will be a bit busy with release work but
after that I may find time to review it myself, as it sounds like an
easy change.  But I'll comment on something I immediately spotted.

>
> On Fri, May 5, 2023 at 11:32 AM Adam Johnson via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
>>
>> From: Adam Johnson <me@adamj.eu>
>>
>> This note was added with the command in 46e91b663b (checkout: split part of

"command" -> "commit", I think.

```

## Adam Johnson via GitGitGadget, 2023-06-01 21:14

Subject: [PATCH v2] doc: restore: remove note on --patch w/ pathspecs
Message-ID: <pull.1504.v2.git.git.1685654097812.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/pull.1504.v2.git.git.1685654097812.gitgitgadget%40gmail.com
In-Reply-To: <pull.1504.git.git.1683282753768.gitgitgadget@gmail.com>

```
From: Adam Johnson <me@adamj.eu>

This note was added with the restore command docs in 46e91b663b
(checkout: split part of it to new command 'restore', 2019-04-25), but it is
now inaccurate. The underlying builtin `add -i` implementation, made default
in 0527ccb1b5 (add -i: default to the built-in implementation, 2021-11-30),
supports pathspecs, so `git restore -p <pathspec>...` has worked for all
users since then. I bisected to verify this was the commit that added
support.

Signed-off-by: Adam Johnson <me@adamj.eu>
---
    doc: restore: remove note on --patch w/ pathspecs
    
    This note was added with the command in 46e91b663b, but it is now
    inaccurate. The underlying builtin add -i implementation, made default
    in 0527ccb1b5, does support pathspecs, so git restore -p <pathspec>...
    has worked for all users since then. I bisected to verify this.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1504%2Fadamchainz%2Faj%2Fgit-restore-patch-docs-fix-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1504/adamchainz/aj/git-restore-patch-docs-fix-v2
Pull-Request: https://github.com/git/git/pull/1504

Range-diff vs v1:

 1:  784143b9949 ! 1:  556f4323ce6 doc: restore: remove note on --patch w/ pathspecs
     @@ Metadata
       ## Commit message ##
          doc: restore: remove note on --patch w/ pathspecs
      
     -    This note was added with the command in 46e91b663b (checkout: split part of
     -    it to new command 'restore', 2019-04-25), but it is now inaccurate. The
     -    underlying builtin `add -i` implementation, made default in 0527ccb1b5 (add
     -    -i: default to the built-in implementation, 2021-11-30), supports pathspecs,
     -    so `git restore -p <pathspec>...` has worked for all users since then. I
     -    bisected to verify this was the commit that added support.
     +    This note was added with the restore command docs in 46e91b663b
     +    (checkout: split part of it to new command 'restore', 2019-04-25), but it is
     +    now inaccurate. The underlying builtin `add -i` implementation, made default
     +    in 0527ccb1b5 (add -i: default to the built-in implementation, 2021-11-30),
     +    supports pathspecs, so `git restore -p <pathspec>...` has worked for all
     +    users since then. I bisected to verify this was the commit that added
     +    support.
      
          Signed-off-by: Adam Johnson <me@adamj.eu>
      


 Documentation/git-restore.txt | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/Documentation/git-restore.txt b/Documentation/git-restore.txt
index 5964810caa4..d31a06a673e 100644
--- a/Documentation/git-restore.txt
+++ b/Documentation/git-restore.txt
@@ -51,9 +51,6 @@ leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
 	restore source and the restore location. See the ``Interactive
 	Mode'' section of linkgit:git-add[1] to learn how to operate
 	the `--patch` mode.
-+
-Note that `--patch` can accept no pathspec and will prompt to restore
-all modified paths.
 
 -W::
 --worktree::

base-commit: f285f68a132109c234d93490671c00218066ace9
-- 
gitgitgadget

```

## Johannes Schindelin, 2025-03-16 00:47

Subject: Re: [PATCH v2] doc: restore: remove note on --patch w/ pathspecs
Message-ID: <8c8da3d4-5184-f83c-c08c-51805fe9ca99@gmx.de>
URL: https://gitlist.dev/e/8c8da3d4-5184-f83c-c08c-51805fe9ca99%40gmx.de
In-Reply-To: <pull.1504.v2.git.git.1685654097812.gitgitgadget@gmail.com>

```
Hi Adam,

On Thu, 1 Jun 2023, Adam Johnson via GitGitGadget wrote:

> From: Adam Johnson <me@adamj.eu>
>
> This note was added with the restore command docs in 46e91b663b
> (checkout: split part of it to new command 'restore', 2019-04-25), but it is
> now inaccurate. The underlying builtin `add -i` implementation, made default
> in 0527ccb1b5 (add -i: default to the built-in implementation, 2021-11-30),
> supports pathspecs, so `git restore -p <pathspec>...` has worked for all
> users since then. I bisected to verify this was the commit that added
> support.
>
> Signed-off-by: Adam Johnson <me@adamj.eu>
> ---
>     doc: restore: remove note on --patch w/ pathspecs
>
>     This note was added with the command in 46e91b663b, but it is now
>     inaccurate. The underlying builtin add -i implementation, made default
>     in 0527ccb1b5, does support pathspecs, so git restore -p <pathspec>...
>     has worked for all users since then. I bisected to verify this.
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1504%2Fadamchainz%2Faj%2Fgit-restore-patch-docs-fix-v2
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1504/adamchainz/aj/git-restore-patch-docs-fix-v2
> Pull-Request: https://github.com/git/git/pull/1504
>
> Range-diff vs v1:
>
>  1:  784143b9949 ! 1:  556f4323ce6 doc: restore: remove note on --patch w/ pathspecs
>      @@ Metadata
>        ## Commit message ##
>           doc: restore: remove note on --patch w/ pathspecs
>
>      -    This note was added with the command in 46e91b663b (checkout: split part of
>      -    it to new command 'restore', 2019-04-25), but it is now inaccurate. The
>      -    underlying builtin `add -i` implementation, made default in 0527ccb1b5 (add
>      -    -i: default to the built-in implementation, 2021-11-30), supports pathspecs,
>      -    so `git restore -p <pathspec>...` has worked for all users since then. I
>      -    bisected to verify this was the commit that added support.
>      +    This note was added with the restore command docs in 46e91b663b
>      +    (checkout: split part of it to new command 'restore', 2019-04-25), but it is
>      +    now inaccurate. The underlying builtin `add -i` implementation, made default
>      +    in 0527ccb1b5 (add -i: default to the built-in implementation, 2021-11-30),
>      +    supports pathspecs, so `git restore -p <pathspec>...` has worked for all
>      +    users since then. I bisected to verify this was the commit that added
>      +    support.
>
>           Signed-off-by: Adam Johnson <me@adamj.eu>

You clearly have addressed Junio's concern, and since the reasoning in the
commit message is valid and the diff is trivially correct, this patch
should be good to go.

Ciao,
Johannes

>
>
>
>  Documentation/git-restore.txt | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/Documentation/git-restore.txt b/Documentation/git-restore.txt
> index 5964810caa4..d31a06a673e 100644
> --- a/Documentation/git-restore.txt
> +++ b/Documentation/git-restore.txt
> @@ -51,9 +51,6 @@ leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
>  	restore source and the restore location. See the ``Interactive
>  	Mode'' section of linkgit:git-add[1] to learn how to operate
>  	the `--patch` mode.
> -+
> -Note that `--patch` can accept no pathspec and will prompt to restore
> -all modified paths.
>
>  -W::
>  --worktree::
>
> base-commit: f285f68a132109c234d93490671c00218066ace9
> --
> gitgitgadget
>

```

## Junio C Hamano, 2025-03-17 22:11

Subject: Re: [PATCH v2] doc: restore: remove note on --patch w/ pathspecs
Message-ID: <xmqq5xk78g02.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqq5xk78g02.fsf%40gitster.g
In-Reply-To: <8c8da3d4-5184-f83c-c08c-51805fe9ca99@gmx.de>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi Adam,
> ...
> commit message is valid and the diff is trivially correct, this patch
> should be good to go.
>
> Ciao,
> Johannes

Thanks, both.  Will queue.

```
