From: Jakub Narebski <jnareb@gmail.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 01/14] Extend index to save more flags
Date: Sun, 28 Sep 2008 13:59:46 +0200 [thread overview]
Message-ID: <200809281359.46858.jnareb@gmail.com> (raw)
In-Reply-To: <48d723bf90941_5de93fcd2ee870984625e@app02.zenbe.com.tmail>
On Mon, 22 Sep 2008, Duy Nguyen wrote:
> On 09/22/2008 "Jakub Narebski" <jnareb@gmail.com> wrote:
>>On Sun, 21 Sep 2008, Nguyen Thai Ngoc Duy wrote:
>>> On 9/21/08, Jakub Narebski <jnareb@gmail.com> wrote:
>>>>> +
>>>>> +#define CE_EXTENDED_FLAGS (0)
>>>>> +
>>>>> +/*
>>>>> + * Safeguard to avoid saving wrong flags:
>>>>> + * - CE_EXTENDED2 won't get saved until its semantic is known
>>>>> + * - Bits in 0x0000FFFF have been saved in ce_flags already
>>>>> + * - Bits in 0x003F0000 are currently in-memory flags
>>>>> + */
>>>>> +#if CE_EXTENDED_FLAGS & 0x80CFFFFF
>>>>> +#error "CE_EXTENDED_FLAGS out of range"
>>>>> +#endif
>>>>
>>>>
>>>> I don't quite understand the above fragment (especially with the fact
>>>> that CE_EXTENDED_FLAGS is defined as (0))...
>>>
>>> Because this patch does not introduce any new on-disk flag yet so
>>> CE_EXTENDED_FLAGS remains 0. In the next patch, CE_EXTENDED_FLAGS will
>>> be updated to have CE_NO_CHECKOUT.
>>
>> Well, now I understand CE_EXTENDED_FLAGS being (0).
>>
>> What I still don't understand the pattern it is protected against.
>> As I understand it if CE_EXTENDED_FLAGS & 0x0000FFFF it is bad,
>> because ce_flags saved flags are not extended flags, and
>> CE_EXTENDED_FLAGS & 0x003F0000 are in-memory flags. But why
>> CE_EXTENDED_FLAGS & 0x80C00000 is bad, and why (if I understand it)
>> CE_EXTENDED_FLAGS & 0x00300000 is not bad.
>
> Wrong bit computation, should be "#if CE_EXTENDED_FLAGS & 0x803FFFFF".
> Thanks for pointing out.
So now there is:
Now CE_EXTENDED_FLAGS & 0x803FFFFF is bad because:
* CE_EXTENDED_FLAGS & 0x0000FFFF are saved flags (not extended)
* CE_EXTENDED_FLAGS & 0x003F0000 are in-memory flags
* CE_EXTENDED_FLAGS & 0x80000000 is 'extra flags' bit
(this is not mentioned in quoted comment; I'm not sure if
it needs to be or not)
Is that correct?
--
Jakub Narebski
Poland
next parent reply other threads:[~2008-09-28 12:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <48d723bf90941_5de93fcd2ee870984625e@app02.zenbe.com.tmail>
2008-09-28 11:59 ` Jakub Narebski [this message]
2008-09-28 12:21 ` [PATCH 01/14] Extend index to save more flags Nguyen Thai Ngoc Duy
2008-09-20 10:01 [PATCH v2 00/14] Sparse checkout Nguyễn Thái Ngọc Duy
2008-09-20 10:01 ` [PATCH 01/14] Extend index to save more flags Nguyễn Thái Ngọc Duy
2008-09-20 21:59 ` Jakub Narebski
2008-09-20 22:23 ` Junio C Hamano
2008-09-20 22:26 ` Junio C Hamano
2008-09-21 4:34 ` Nguyen Thai Ngoc Duy
2008-09-21 22:21 ` Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200809281359.46858.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).