Re: update-index --really-refresh unsets assume-unchanged bit

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

 



On Tue, May 4, 2010 at 4:57 AM, Clemens Buchacher <drizzd@xxxxxx> wrote:
> On Sat, May 01, 2010 at 11:27:20AM +0200, Clemens Buchacher wrote:
>
>>  --really-refresh::
>>       Like '--refresh', but checks stat information unconditionally,
>> -     without regard to the "assume unchanged" setting.
>> +     without regard to the "assume unchanged" setting. The "assume
>> +     unchanged" bit is unset for all paths.
>
> Scratch that latter part, please. I just noticed the bit is unset only for
> modified files. If the file matches the index, or even if it has been
> deleted in the work tree, the bit is _not_ unset.
>
> So the current behavior is quite strange. I see several possible
> interpretations of --really-refresh:

I don't know, the current behaviour sounds consistent with the name:
"assume unchanged."

If the index says the file is unmodified, then assume it's unchanged;
don't check for changes.

If the index says the file is modified, then clearly it's changed; it
would be pointless to assume otherwise, so the "assume unchanged" bit
should probably not be set.  (Plus it's quite possibly dangerous to
assume the file permissions are the same as they were when you first
noticed they were changed; imagine if the file has changed twice and
now has a different length or mode.)

Since most of the time most of your files won't have changed,
assume-unchanged gets you the optimization without too much danger.
The cost of not assuming a changed file is unchanged is pretty low.

...now if only there was a global "just never check for changes or new
files or anything, even if I run git status" bit, someone could write
a useful git inotify daemon :)

Have fun,

Avery
--
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]