From: Junio C Hamano <gitster@pobox.com>
To: David Turner <dturner@twopensource.com>
Cc: git@vger.kernel.org, David Turner <dturner@twitter.com>
Subject: Re: [PATCH v4 2/4] test-dump-cache-tree: invalid trees are not errors
Date: Mon, 07 Jul 2014 12:27:35 -0700 [thread overview]
Message-ID: <xmqqa98lc6l4.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1404619619-4774-2-git-send-email-dturner@twitter.com> (David Turner's message of "Sat, 5 Jul 2014 21:06:57 -0700")
David Turner <dturner@twopensource.com> writes:
> Do not treat known-invalid trees as errors even when their count is
> incorrect. Because git already knows that these trees are invalid,
> nothing depends on the count field.
s/count/subtree_nr/; they are different.
"nothing depends on" is not quite correct. The field keeps track of
the number of subdirectories in the directory recorded in the
cache-tree, and it *must* be maintained correctly (we iterate over
the it->down[] array up to that number).
The number of subdirectories the directory actually has, which we
can discover by counting entries in the main part of the index, may
be different from subtree_nr, if we haven't run update_one() on it,
e.g. we may have added a path in a new subdirectory, at which time
we would have invalidated the directory and its it->down[] array does
not know the new subdirectory.
While reading 3/4, I wondered if it makes sense to show the (N
subtrees) for invalidated node, but as a debugging measure it helped
me often while developping the framework, so we may not want to drop
the subtree_nr from the output for invalidated entries.
The change itself looks good.
Thanks.
next prev parent reply other threads:[~2014-07-07 19:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-06 4:06 [PATCH v4 1/4] cache-tree: Create/update cache-tree on checkout David Turner
2014-07-06 4:06 ` [PATCH v4 2/4] test-dump-cache-tree: invalid trees are not errors David Turner
2014-07-07 19:27 ` Junio C Hamano [this message]
2014-07-06 4:06 ` [PATCH v4 3/4] cache-tree: subdirectory tests David Turner
2014-07-06 8:10 ` Eric Sunshine
2014-07-07 19:15 ` Junio C Hamano
2014-07-06 4:06 ` [PATCH v4 4/4] cache-tree: Write updated cache-tree after commit David Turner
2014-07-07 20:03 ` Junio C Hamano
2014-07-08 0:26 ` Junio C Hamano
2014-07-08 10:32 ` Duy Nguyen
2014-07-08 17:05 ` Junio C Hamano
2014-07-09 1:58 ` Duy Nguyen
2014-07-08 18:32 ` Junio C Hamano
2014-07-08 19:15 ` Junio C Hamano
2014-07-07 18:58 ` [PATCH v4 1/4] cache-tree: Create/update cache-tree on checkout Junio C Hamano
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=xmqqa98lc6l4.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=dturner@twitter.com \
--cc=dturner@twopensource.com \
--cc=git@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.