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.)