git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Brandon Williams <bmwill@google.com>
Cc: git@vger.kernel.org
Subject: [BUG] fetching sometimes doesn't update refs
Date: Sun, 29 Jul 2018 08:19:00 -0400	[thread overview]
Message-ID: <20180729121900.GA16770@sigill.intra.peff.net> (raw)

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

             reply	other threads:[~2018-07-29 12:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-29 12:19 Jeff King [this message]
2018-07-30 17:53 ` [BUG] fetching sometimes doesn't update refs Brandon Williams
2018-07-30 22:56 ` [PATCH] transport: report refs only if transport does Jonathan Tan
2018-07-31 19:24   ` Jeff King
2018-07-31 21:38     ` Junio C Hamano
2018-07-31 23:29       ` Jonathan Tan
2018-07-31 23:23     ` Jonathan Tan
2018-08-01 17:18       ` Brandon Williams
2018-08-02 16:30       ` Jeff King
2018-08-01 20:13 ` [PATCH] fetch-pack: unify ref in and out param Jonathan Tan
2018-08-01 21:38   ` Brandon Williams
2018-08-01 22:23     ` Junio C Hamano
2018-08-02 16:40   ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180729121900.GA16770@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=bmwill@google.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).