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

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

From
Adam Johnson via GitGitGadget <gitgitgadget@gmail.com>
Date
May 5, 2023, 10:32 UTC
Message-ID
<pull.1504.git.git.1683282753768.gitgitgadget@gmail.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
Next: Adam Johnson
Message 1 of 6 in “doc: restore: remove note on --patch w/ pathspecs”
  1. doc: restore: remove note on --patch w/ pathspecsAdam Johnson via GitGitGadget, May 5, 2023
  2. Adam JohnsonMay 25, 2023
  3. Junio C HamanoJun 1, 2023
  4. doc: restore: remove note on --patch w/ pathspecsAdam Johnson via GitGitGadget, Jun 1, 2023
  5. Johannes SchindelinMar 16, 2025
  6. Junio C HamanoMar 17, 2025

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.