Re: [PATCH 2/6] read-cache: new extension to mark what file is watched

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

 



On Tue, Jan 14, 2014 at 12:02 AM, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote:
> Hi,
>
> Nguyễn Thái Ngọc Duy wrote:
>
>> If an entry is "watched", git lets an external program decide if the
>> entry is modified or not. It's more like --assume-unchanged, but
>> designed to be controlled by machine.
>>
>> We are running out of on-disk ce_flags, so instead of extending
>> on-disk entry format again, "watched" flags are in-core only and
>> stored as extension instead.
>
> Makes sense.
>
> Care to add a brief description of the on-disk format for
> Documetnation/technical/index-format.txt as well?

Sure, in the reroll after I fix inotify bugs that make the test suite fail.

>> +static void read_watch_extension(struct index_state *istate, uint8_t *data,
>> +                              unsigned long sz)
>> +{
>> +     int i;
>> +     if ((istate->cache_nr + 7) / 8 != sz) {
>> +             error("invalid 'WATC' extension");
>> +             return;
>> +     }
>> +     for (i = 0; i < istate->cache_nr; i++)
>> +             if (data[i / 8] & (1 << (i % 8)))
>> +                     istate->cache[i]->ce_flags |= CE_WATCHED;
>> +}
>
> So the WATC section has one bit per index entry, encoding whether that
> entry is WATCHED.  Makes sense.
>
> Do I understand correctly that this patch just takes care of the
> bookkeeping for the CE_WATCHED bit and the actual semantics will
> come in a later patch?

Correct.
-- 
Duy
--
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]