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

[PATCH 0/2] enhance "git restore --worktree --staged" behavior

From
Eric Sunshine <sunshine@sunshineco.com>
Date
May 1, 2020, 08:27 UTC
Message-ID
<20200501082746.23943-1-sunshine@sunshineco.com>

This series addresses a shortcoming or two when git-restore's --worktree and --staged options are combined. The first patch tightens the implementation to match the documentation. The second patch loosens the documented restriction by adding a bit of DWIMing to make it more convenient to combine the two options.

Although the second patch effectively throws away the changes of the first patch, I kept them separate in case someone comes up with a good objection to the new DWIMing (which escaped me), in which case the first patch can be kept and the second thrown away.

Eric Sunshine (2):
  restore: require --source when combining --worktree and --staged
  restore: default to HEAD when combining --worktree and --staged
 Documentation/git-restore.txt | 13 +++++++------
 builtin/checkout.c            |  6 +++---
 t/t2070-restore.sh            | 11 +++++++++++
 3 files changed, 21 insertions(+), 9 deletions(-)
-- 
2.26.2.526.g744177e7f7
Next: Eric Sunshine
Message 1 of 10 in “enhance "git restore --worktree --staged" behavior”
  1. 0/2 enhance "git restore --worktree --staged" behaviorEric Sunshine, May 1, 2020
  2. 1/2 restore: require --source when combining --worktree and --stagedEric Sunshine, May 1, 2020
  3. Eric SunshineMay 1, 2020
  4. Taylor BlauMay 1, 2020
  5. 2/2 restore: default to HEAD when combining --worktree and --stagedEric Sunshine, May 1, 2020
  6. Junio C HamanoMay 1, 2020
  7. Eric SunshineMay 5, 2020
  8. Taylor BlauMay 1, 2020
  9. Eric SunshineMay 5, 2020
  10. Taylor BlauMay 5, 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.