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

Re: Issue when adding new files to staged changes using interactive mode

From
Raymond E. Pasco <ray@ameretat.dev>
Date
Jul 29, 2020, 21:30 UTC
Message-ID
<C4JFF5L90V54.1FQKYQPIC3O43@ziyou.local>
In-Reply-To
<C4JC6LFSAFFS.2U4ZZ9ZMO066A@ziyou.local>

Before I continue rooting around in the source, though, I wonder if the real issue here isn't the fact that add -p fails to support new files (requiring the intent-to-add workaround in the first place). I have always thought it's a confusing user experience that git add -p on a file that isn't yet tracked simply returns "No changes".

The underlying problem may be, and I say this without intimate knowledge of the subsystem, that we're now trying to force add-patch.c to do something it doesn't actually support, namely new files, whereas before it was attempting to patch what it saw as an empty file.

This (patch-adding new files) is real in my workflow; is there any reason why git add -p with an explicit argument shouldn't attempt to add untracked files covered by the explicit argument? (In addition to fixing it for intent-to-adds.)

Previous: Raymond E. PascoNext: Another Email
Message 3 of 5 in “Issue when adding new files to staged changes using interactive mode”
  1. Another EmailJul 28, 2020
  2. Raymond E. PascoJul 29, 2020
  3. Raymond E. PascoJul 29, 2020
  4. Another EmailJul 29, 2020
  5. Taylor BlauJul 31, 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.