Re: bug report on update-index --assume-unchanged

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

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> If however you did something that made Git notice that you changed
> these paths marked with assume-unchanged bit anyway, then Git will,
> well, notice that they are not "unchanged" as you promised.

By the way, this cuts both ways.  I would not bother checking with
the current codebase, but I know it used to be that when we have a
blob object name and need a temporary file that holds the content
for read-only purpose (e.g. passing a pair of files to external diff
driver), we allowed Git to reuse files in the working tree whose
blob object name we knew.  This is of course because it is faster
than inflating the blob contents out of the object store and writing
a new file.

That codepath is allowed to "borrow" the working tree file as such a
temporary file for read-only purpose, when a file is stat-clean
(i.e. its contents is known to match the blob object recorded in the
index).  A file with assume-unchanged bit set is treated exactly the
same way, because the user promised not to modify it.

If the user broke the promise, then an external diff driver would
have been given a file whose contents does not actually match the
wanted blob object, resulting in an incorrect diff output.
--
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]