git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG] fetching sometimes doesn't update refs

From
BWBrandon Williams <bmwill@google.com>
Date
Jul 30, 2018, 17:53 UTC
Message-ID
<20180730175341.GB154732@google.com>
In-Reply-To
<20180729121900.GA16770@sigill.intra.peff.net>
On 07/29, Jeff King wrote:
Show 11 quoted lines
> I've noticed for the past couple of weeks that some of my fetches don't
> seem to actually update refs, but a follow-up fetch will. I finally
> managed to catch it in the act and track it down. It bisects to your
> 989b8c4452 (fetch-pack: put shallow info in output parameter,
> 2018-06-27). 
> 
> A reproduction recipe is below. I can't imagine why this repo in
> particular triggers it, but it was the one where I initially saw the
> problem (and doing a tiny reproduction does not seem to work). I'm
> guessing it has something to do with the refs, since the main change in
> the offending commit is that we recompute the refmap.

I've noticed this behavior sporadically as well, though I've never been able to reliably reproduce it, so thanks for creating a reproduction recipe. I suspected that it had to do with the ref-in-want series so thanks for tracking that down too. We'll take a look.

Show 24 quoted lines
> 
> -- >8 --
> # clone the repo as it is today
> git clone https://github.com/cmcaine/tridactyl.git
> cd tridactyl
> 
> # roll back the refs so that there is something to fetch
> for i in refs/heads/master refs/remotes/origin/master; do
> 	git update-ref $i $i^
> done
> 
> # and delete the now-unreferenced objects, pretending we are an earlier
> # clone that had not yet fetched
> rm -rf .git/logs
> git repack -ad
> 
> # now fetch; this will get the objects but fail to update refs
> git fetch
> 
> # and fetching again will actually update the refs
> git fetch
> -- 8< --
> 
> -Peff
-- 
Brandon Williams
Previous: Jeff KingNext: Jonathan Tan
Message 2 of 13 in “[BUG] fetching sometimes doesn't update refs”
  1. Jeff KingJul 29, 2018
  2. Brandon WilliamsJul 30, 2018
  3. transport: report refs only if transport doesJonathan Tan, Jul 30, 2018
  4. Jeff KingJul 31, 2018
  5. Junio C HamanoJul 31, 2018
  6. Jonathan TanJul 31, 2018
  7. Jonathan TanJul 31, 2018
  8. Brandon WilliamsAug 1, 2018
  9. Jeff KingAug 2, 2018
  10. fetch-pack: unify ref in and out paramJonathan Tan, Aug 1, 2018
  11. Brandon WilliamsAug 1, 2018
  12. Junio C HamanoAug 1, 2018
  13. Jeff KingAug 2, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.