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

[BUG] fetching sometimes doesn't update refs

From
Jeff King <peff@peff.net>
Date
Jul 29, 2018, 12:19 UTC
Message-ID
<20180729121900.GA16770@sigill.intra.peff.net>

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.

-- >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
Next: Brandon Williams
Message 1 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.