Re: [RFC PATCH] Not computing changed path filter for root commits
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Sep 15, 2023, 20:29 UTC
- Message-ID
- <20230915202912.GA8705@szeder.dev>
- In-Reply-To
- <20230911223157.446269-1-jonathantanmy@google.com>
On Mon, Sep 11, 2023 at 03:31:56PM -0700, Jonathan Tan wrote:
Show 7 quoted lines
> SZEDER Gábor suggested [2] that we change the revision walk to read > changed path filters also for root commits, but I don't think that's > possible - we have to tie reading changed path filters to when we read > trees, and right now, we don't seem to read trees when evaluating root > commits (rev_compare_tree() in revision.c is in the only code path that > uses changed path filters, and it itself is only called per-parent and > thus not called for root commits).
When encountering a root commit during a pathspec-limited revision walk we call rev_same_tree_as_empty() instead of rev_compare_tree(). All that's missing there is checking the Bloom filter and accounting for false positives.