From: Derrick Stolee <stolee@gmail.com>
To: Jeff King <peff@peff.net>,
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, jrnieder@gmail.com,
Derrick Stolee <dstolee@microsoft.com>
Subject: Re: [PATCH] fetch: add --no-update-remote-refs
Date: Mon, 20 Jan 2020 19:57:43 -0500 [thread overview]
Message-ID: <4e444a99-6785-1d11-d8cf-87903c3b3760@gmail.com> (raw)
In-Reply-To: <20200117192016.GB11358@coredump.intra.peff.net>
On 1/17/2020 2:20 PM, Jeff King wrote:
> On Fri, Jan 17, 2020 at 03:28:59PM +0000, Derrick Stolee via GitGitGadget wrote:
>> Add a --[no-]update-remote-refs option to 'git fetch' which defaults
>> to the existing behavior of updating the remote refs. This allows
>> a user to run
>>
>> git fetch <remote> --no-update-remote-refs +refs/heads/*:refs/hidden/*
>>
>> to populate a custom ref space and download a pack of the new
>> reachable objects. This kind of call allows a few things to happen:
> But I think there's already a way to do that: the --refmap option added
> by c5558f80c3 (fetch: allow explicit --refmap to override configuration,
> 2014-05-29). Using an empty refmap like:
>
> git fetch --refmap= <remote> refs/heads/*:refs/hidden/*
>
> should do what you want. It suppresses the use of the configured
> refspecs, so we don't find any opportunistic mappings to make.
You're absolutely right. There are details at [1].
The tricky thing is that the documentation makes it look like you
need a value there, and if you supply a value without a refspec
argument, an error is given:
$ git fetch origin --refmap="+refs/heads/*:refs/hidden/origin/*"
fatal: --refmap option is only meaningful with command-line refspec(s).
I think I'll follow up with a documentation patch to point out
that an empty --refmap value will ignore the configured refspec
and rely only on the provided refspec argument.
Thanks!
-Stolee
[1] https://git-scm.com/docs/git-fetch#_configured_remote_tracking_branches_a_id_crtb_a
next prev parent reply other threads:[~2020-01-21 0:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-17 15:28 [PATCH] fetch: add --no-update-remote-refs Derrick Stolee via GitGitGadget
2020-01-17 16:23 ` Eric Sunshine
2020-01-17 19:13 ` Junio C Hamano
2020-01-17 19:26 ` Jeff King
2020-01-20 14:44 ` Derrick Stolee
2020-01-17 19:20 ` Jeff King
2020-01-21 0:57 ` Derrick Stolee [this message]
2020-01-21 1:38 ` [PATCH v2] fetch: document and test --refmap="" Derrick Stolee via GitGitGadget
2020-01-21 16:24 ` Jeff King
2020-01-21 18:01 ` Derrick Stolee
2020-01-21 19:06 ` Jeff King
2020-01-21 18:22 ` Junio C Hamano
2020-01-21 18:24 ` Junio C Hamano
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=4e444a99-6785-1d11-d8cf-87903c3b3760@gmail.com \
--to=stolee@gmail.com \
--cc=dstolee@microsoft.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=jrnieder@gmail.com \
--cc=peff@peff.net \
/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;
as well as URLs for NNTP newsgroup(s).