Re: [PATCH 1/2] Check order when reading index
- From
Jaime Soriano Pastor <jsorianopastor@gmail.com>
- Date
- Aug 25, 2014, 20:26 UTC
- Message-ID
- <CAPuZ2NGy7VSW0ibfXwqAndJbDcnByDMJzNZrrLDYt8vDfYPYTg@mail.gmail.com>
- In-Reply-To
- <xmqqvbpgmqmh.fsf@gitster.dls.corp.google.com>
On Mon, Aug 25, 2014 at 7:21 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 14 quoted lines
> Jaime Soriano Pastor <jsorianopastor@gmail.com> writes: > >> Subject: Re: [PATCH 1/2] Check order when reading index > > Please be careful when crafting the commit title. This single line > will be the only one that readers will have to identify the change > among hundreds of entries in "git shortlog" output when trying to > see what kind of change went into the project during the given > period. Something like: > > read_index_from(): catch out of order entries while reading an index file > > perhaps? >
Ok, reprashing it.
>> +void check_ce_order(struct cache_entry *ce, struct cache_entry *next_ce) > > Does this have to be global, i.e. not "static void ..."? >
Not really, changing it to static.
Show 10 quoted lines
>> + if (ce_stage(ce) >= ce_stage(next_ce))
>> + die("Unordered stage entries for '%s'",
>> + ce->name);
>
> Not quite. We do allow multiple higher stage entries; having two or
> more stage #1 entries is perfectly fine during a merge resolution,
> and both ce and next_ce may be pointing at the stage #1 entries of
> the same path. Replacing the comparison with ">" is sufficient, I
> think.
>Ok, but like Jeff, I'm also curious about how to have multiple stage #1 entries for the same path.
Thanks.