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

bug: git-add --patch any negative pathspec fails

From
EEErik Cervin Edin <erik@cervined.in>
Date
Dec 16, 2021, 19:09 UTC
Message-ID
<CA+JQ7M_Q2bgHWt_SFWdMCHkqqJr2K2VEqDfK4en_eXhs0o5JgQ@mail.gmail.com>

Steps to reproduce: git-add -p -- ':!foo'

Expected: Add everything that doesn't match the pathspec.

Actual: fatal: empty string is not a valid pathspec. please use . instead if you meant to match all paths Cannot close git diff-index --cached --numstat --summary HEAD -- :(exclude,prefix:0)bar () at C:/Program Files/Git/mingw64/libexec/git-core\git-add--interactive line 242.

Relevant trace: 19:44:00.359141 run-command.c:667 trace: run_command: git add--interactive --patch -- ':(exclude,prefix:0)bar' '' Note the added empty string pathspec

Affects: git version 2.31.1.windows.1

Next: Jeff King
Message 1 of 2 in “bug: git-add --patch any negative pathspec fails”
  1. Erik Cervin EdinDec 16, 2021
  2. Jeff KingDec 16, 2021

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.