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

[PATCH 0/1] reset: parse rev as tree-ish in patch mode

From
Nika Layzell via GitGitGadget <gitgitgadget@gmail.com>
Date
Nov 23, 2019, 19:55 UTC
Message-ID
<pull.474.git.1574538937.gitgitgadget@gmail.com>

This allows passing a tree-ish git reset -p without specifying a pathspec. Requiring a commit in this situation appears to be an oversight, and support for a tree-ish is documented by git-reset's manpage. ( https://github.com/git/git/blob/d9f6f3b6195a0ca35642561e530798ad1469bd41/Documentation/git-reset.txt#L12 )

An alternative implementation of this change would move the if (patch_mode) { ... return; } check before the rev parsing logic, offloading validation of the rev argument when in patch mode to the git-add--interactive logic. This would be possible as the parsed oid is not passed to git-add--interactive. ( https://github.com/git/git/blob/d9f6f3b6195a0ca35642561e530798ad1469bd41/builtin/reset.c#L341-L346 )

Nika Layzell (1):
  reset: parse rev as tree-ish in patch mode
 builtin/reset.c        | 2 +-
 t/t7105-reset-patch.sh | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
base-commit: 5fa0f5238b0cd46cfe7f6fa76c3f526ea98148d9
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-474%2Fmystor%2Freset-interactive-treeish-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-474/mystor/reset-interactive-treeish-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/474
-- 
gitgitgadget
Next: Nika Layzell via GitGitGadget
Message 1 of 8 in “reset: parse rev as tree-ish in patch mode”
  1. 0/1 reset: parse rev as tree-ish in patch modeNika Layzell via GitGitGadget, Nov 23, 2019
  2. 1/1 reset: parse rev as tree-ish in patch modeNika Layzell via GitGitGadget, Nov 23, 2019
  3. Junio C HamanoNov 24, 2019
  4. Nika LayzellNov 24, 2019
  5. Junio C HamanoNov 25, 2019
  6. 0/1 reset: parse rev as tree-ish in patch modeNika Layzell via GitGitGadget, Nov 24, 2019
  7. 1/1 reset: parse rev as tree-ish in patch modeNika Layzell via GitGitGadget, Nov 24, 2019
  8. Junio C HamanoNov 25, 2019

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.