Re: [PATCH 3/8] apply: fix adding new files on i-t-a entries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nguyễn Thái Ngọc Duy  <pclouds@xxxxxxxxx> writes:

> Applying a patch that adds a file when that file is registered with "git
> add -N" will fail with message "already exists in index" because
> git-apply checks, sees those i-t-a entries and aborts. git-apply does
> not realize those are for bookkeeping only, they do not really exist in
> the index. This patch tightens the "exists in index" check, ignoring
> i-t-a entries.

Suppose that you came up with some contents to register at path F in
your working tree, told Git about your intention with "add -N F",
and then tried to apply a patch that wants to _create_ F:

Without this patch, we would say "F already exists so a patch to
create is incompatible with our current state".

With this patch, we do not say that, but instead we'll hopefully
trigger "does it exist in the working tree" check, unless you are
running under "--cached".

Which means that this change will not lead to data loss in the
"untracked" file F in the working tree that was merely added to the
index with i-t-a bit.

As you did not say the equivalent of the last paragraph above in the
log message, my knee-jerk reaction was "why could this possibly be a
good idea?"

Please try again with a better log message.

Thanks.


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]