Git development
 help / color / mirror / Atom feed
From: ronan@rjp.ie
To: "Junio C Hamano" <gitster@pobox.com>
Cc: "Chris Torek" <chris.torek@gmail.com>, git@vger.kernel.org
Subject: Re: Git pull without fetch
Date: Sat, 18 Feb 2023 04:33:59 +0000	[thread overview]
Message-ID: <2aff5436d69e09241bee775cf03e9723@rjp.ie> (raw)
In-Reply-To: <xmqqo7prk7vj.fsf@gitster.g>

> That is very much working as designed.

Yes, I realize. I'm not reporting a bug. I guess I just think it would be handy
to more conveniently reach the prefetched updates when I'm offline, and I gather
from conversation there is no method builtin to git.

For now I've settled on this to be "pretend fetch":

$ git for-each-ref refs/prefetch/ --format='update refs/%(refname:lstrip=2) (refname)' | git update-ref --stdin

which I can follow-up with a no-argument `git rebase`, similar to a `git pull`
if the remote was available.

In my original question I had intended only to update the upstream of my current
branch, but I've decided that's not necessary for me. However, I have found that
it is possible to get the upstream reference for the current branch like so:

$ git rev-parse --symbolic-full-name '@{upstream}' refs/remotes/origin/master

using this it should be possible to find the corresponding prefetched reference
in refs/prefetch if it exists and only update that reference without parsing
"branch.<name>.remote", "remote.<name>.fetch", and "branch.<name>.merge" myself.

      reply	other threads:[~2023-02-18  4:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-18  0:09 Git pull without fetch ronan
     [not found] ` <CAPx1Gvd8vizeyveKgE2o2GStQsiGxN4aaASqYc81Nk28ogFLJg@mail.gmail.com>
2023-02-18  2:02   ` ronan
2023-02-18  2:46     ` Junio C Hamano
2023-02-18  4:33       ` ronan [this message]

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

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

  git send-email \
    --in-reply-to=2aff5436d69e09241bee775cf03e9723@rjp.ie \
    --to=ronan@rjp.ie \
    --cc=chris.torek@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox