Re: [PATCH 1/5] apply: error on --intent-to-add outside gitdir
- From
Raymond E. Pasco <ray@ameretat.dev>
- Date
- Jul 1, 2025, 05:26 UTC
- Message-ID
- <lhhs5j47cnvhp7zcqtcfr725els2dlvoufsp7mexn3isivnpnv@ode3ul6ds3sa>
- In-Reply-To
- <xmqqfrfh13k5.fsf@gitster.g>
On 25/06/30 11:34AM, Junio C Hamano wrote:
Show 17 quoted lines
> "Raymond E. Pasco" <ray@ameretat.dev> writes: > > > It makes no sense to register an intent to add outside a repository. We > > should error out here. > > I am not so sure, especially if you still keep the original "if we > are using 'git apply' as a better GNU patch, ignore -N" logic. > > Not that I am suggesting to also error out when -N is given without > --index or --cached, that is. > > I think the most problematic is the claim "it makes no sense" is not > linked to the conclusion "we should error out". The behaviour of > the original code, and the behaviour of the code with this patch in > "a better GNU patch" mode is based on "it makes no sense in such a > context, hence we just ignore (instead of erroring out)", which > makes perfect sense as well.
Yeah, perhaps that's right. My thought was that "the user said -N, they must think they're in a repository". On the other hand, however, it's a lot weaker than saying --index or --cached, which mean the user definitely wants to manipulate a git repository; the user is still /mainly/ trying to manipulate files if they use -N.