It is possible to delete a committed file from the index and then add it
as intent-to-add. After `git reset HEAD`, the file should be identical
in the index and HEAD. This patch provides the desired behavior even
when the file is empty in the index.
Signed-off-by: Varun Naik
---
My first patch
then invoking any command that reads from the
index.
Signed-off-by: Varun Naik
---
I believe this is the only place that calls xmmap() when it should be
calling xmmap_gently(). There is a related recent commit 3203566a71
("Use xmmap_gently instead of xmmap in use_pack", 2019-05-1
It is possible to delete a committed file from the index and then add it
as intent-to-add. After `git reset HEAD`, the file should be identical
in the index and HEAD. This patch provides the desired behavior even
when the file is empty in the index.
Signed-off-by: Varun Naik
---
CC Duy because
: Varun Naik
---
CC Jeff because you wrote the code that I am changing now.
checkout.c:update_some() discards the newly created cache entry when its
mode and oid match those of the old entry. Since an ita file has the
same oid as an empty file, an empty deleted ita file passes both of
these checks, and
Got the CC list wrong in the first email...
Varun
On Thu, Jul 25, 2019 at 9:57 PM Varun Naik wrote:
>
> It is possible to delete a committed file from the index and then add it
> as intent-to-add. After `git checkout HEAD` or `git restore --staged`,
> the file should be identical
On Fri, Jul 26, 2019 at 11:20 AM Junio C Hamano wrote:
>
> Varun Naik writes:
>
> > It is possible to delete a committed file from the index and then add it
> > as intent-to-add. After `git reset HEAD`, the file should be identical
> > in the index and HEAD. This
On Fri, Jul 26, 2019 at 1:57 AM Jeff King wrote:
>
> On Thu, Jul 25, 2019 at 09:56:45PM -0700, Varun Naik wrote:
>
> > It is possible to delete a committed file from the index and then add it
> > as intent-to-add. After `git checkout HEAD` or `git restore --staged`,
&
instead.
This change should not affect newly added ita files. For those, inside
tree.c:read_tree_1(), tree_entry_interesting() returns
entry_not_interesting, so fn is never called.
Helped-by: Jeff King
Signed-off-by: Varun Naik
---
This patch fixes and tests only "checkout", because &qu
`git restore --staged` uses the same machinery as `git checkout HEAD`,
so there should be a similar test case for "restore" as the existing
test case for "checkout" with deleted ita files.
Helped-by: Jeff King
Signed-off-by: Varun Naik
---
This is the "restore" p
, the
"tree" cache entry is NULL, so the changed code is not executed.
Helped-by: Junio C Hamano
Signed-off-by: Varun Naik
---
I tried to limit the "blast radius" of affected commands as much as
possible. To find commands that were affected, I ran the following:
git diff
instead.
This change should not affect newly added ita files. For those, inside
tree.c:read_tree_1(), tree_entry_interesting() returns
entry_not_interesting, so fn is never called.
Helped-by: Jeff King
Signed-off-by: Varun Naik
---
This patch fixes and tests "checkout". New in v3 is a
leted ita file was previously considered the "same" as the cache entry
for an empty file. This fix adds a comparison of the intent-to-add bits
so that the two cache entries are no longer considered the "same".
Signed-off-by: Varun Naik
---
I am marking this patch as RFC be
On Tue, Aug 13, 2019 at 1:33 PM Junio C Hamano wrote:
>
> The original code considered that two entries with the same mode and
> the same "contents" are the same. As nobody sane tracks an empty
> file for an extended span of history, that meant that most of the
> time, intent-to-add entries, whic
the "same". This
fix checks the intent-to-add bits so if one or both of the cache entries
are marked as ita, then the two cache entries are not considered the
"same".
Helped-by: René Scharfe
Signed-off-by: Varun Naik
---
I rewrote the code in same(), as René suggested.
Ne
On Thu, Aug 1, 2019 at 9:16 AM Varun Naik wrote:
>
> It is possible to delete a committed file from the index and then add it
> as intent-to-add. Certain forms of `git diff` should show the file.
> After `git reset HEAD`, the file should be identical in the index and
> HEAD. The c
On Thu, Aug 15, 2019 at 9:34 AM Junio C Hamano wrote:
>
> Varun Naik writes:
>
> > On Tue, Aug 13, 2019 at 1:33 PM Junio C Hamano wrote:
> >>
> >> So perhaps
> >>
> >> + !ce_intent_to_add(a) && !ce_intent_to_add(b) &&
On Thu, Aug 15, 2019 at 12:06 PM Junio C Hamano wrote:
>
> /*
> * i-t-a entries do not actually exist in the index (if we're
> * looking at its content)
> */
> if (o->index_only &&
> revs->diffopt.ita_invisible_in_index &&
> idx &&
the "same". This
fix checks the intent-to-add bits so if one or both of the cache entries
are marked as ita, then the two cache entries are not considered the
"same".
Helped-by: René Scharfe
Signed-off-by: Varun Naik
---
I rewrote the code in same(), as René suggested. Someh
18 matches
Mail list logo