Re: [PATCH v2 1/7] fetch: speed up lookup of want refs via commit-graph
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Aug 25, 2021, 14:16 UTC
- Message-ID
- <50329e98-862b-5240-cf6c-cfe4cd7e248c@gmail.com>
- In-Reply-To
- <4a819a68309bf03db2d9a5e5be070e52c3542af8.1629800774.git.ps@pks.im>
On 8/24/2021 6:36 AM, Patrick Steinhardt wrote:
> Speed this up by opportunistcally trying to resolve object IDs via the
s/opportunistcally/opportunistically/
Show 10 quoted lines
> + /* > + * References in "refs/tags/" are often going to point > + * to annotated tags, which are not part of the > + * commit-graph. We thus only try to look up refs in > + * the graph which are not in that namespace to not > + * regress performance in repositories with many > + * annotated tags. > + */ > + if (!starts_with(rm->name, "refs/tags/")) > + commit = lookup_commit_in_graph(the_repository, &rm->old_oid);
This new logic looks good.
Show 7 quoted lines
> + if (!commit) {
> + commit = lookup_commit_reference_gently(the_repository,
> + &rm->old_oid,
> + 1);
> + if (!commit)
> + rm->fetch_head_status = FETCH_HEAD_NOT_FOR_MERGE;
> + }Thanks, -Stolee