Re: Slow fetches of tags
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:27
Linus Torvalds [off-list ref] writes:
Junio? Any ideas? I didn't want to do that tag-auto-following, and while I admit it's damn convenient, it's really quite broken, methinks.
I think the current setup is broken on two counts. If you fetch
without remote tracking branch, I suspect that we end up asking
for the tip of the remote again -- because there is no ref that
says "this commit is known to be complete -- we just fetched
from them successfully".
But I think what Ralf is seeing is a bit different. The example
given:
git fetch git://git.kernel.org/pub/scm/linux/kernel/git/stable/\
linux-2.6.16.y.git master:v2.6.16-stable
does use a tracking branch, and when the tag following kicks in,
v2.6.16-stable head should have been updated. I suspect it is
just its head commit is older than tips of other branches, and
purely date based sorting done by fetch-pack.c::get_rev() ends
up walking them before it gets to the tip of the branch we just
fetched.
I wonder if we can do a dirty hack to give bias to commits
coming from refs that are newer (on the local filesystem -- that
is, mtime of .git/refs/heads/v2.6.16-stable must be a lot newer
than .git/refs/heads/master in this case because we just fetched
it)...