Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15

Re: [PATCH 3/6] Stop producing index version 2

From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:53:00

On Tue, Feb 7, 2012 at 11:50 AM, Nguyen Thai Ngoc Duy [off-list ref] wrote:
quoted
Version 3 was a mistake because of the variable length record sizes.
Saving 2 bytes on some records that don't use the extended flags makes
the index file *MUCH* harder to parse. So much so that we should take
version 3 and kill it, not encourage it as the default!
Probably too late for that, but it's good to know there are strong
user base for v2.
OK probably not too late. We cannot kill it, but we could deprecate
it. We can introduce a mandatory extension to store extra flags. The
extension is basically an array of

struct ce_extended_flags {
    int ce_index; /* points to istate->cache[ce_index] */
    unsigned long flags;
};

On reading the extension, extra flags is applied back in mem, the
extension is created again when new index is written. There are only
two users of index v3: skip-worktree and intent-to-add bits, which are
not used often, I think. Still want to kill it?

Switching from sha-1 to crc32 could be done the same way (i.e. new
mandatory extension _at the end_ that contains crc32 checksum and skip
sha-1 check on reading if it's all zero) if we agree to move to crc32.
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help