From: Junio C Hamano <gitster@pobox.com>
To: "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, jrnieder@gmail.com, peff@peff.net,
Derrick Stolee <dstolee@microsoft.com>
Subject: Re: [PATCH v2] fetch: document and test --refmap=""
Date: Tue, 21 Jan 2020 10:24:24 -0800 [thread overview]
Message-ID: <xmqq1rrsbrc7.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <pull.532.v2.git.1579570692766.gitgitgadget@gmail.com> (Derrick Stolee via GitGitGadget's message of "Tue, 21 Jan 2020 01:38:12 +0000")
"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Derrick Stolee <dstolee@microsoft.com>
>
> To prevent long blocking time during a 'git fetch' call, a user
> may want to set up a schedule for background 'git fetch' processes.
> However, these runs will update the refs/remotes branches due to
> the default refspec set in the config when Git adds a remote.
> Hence the user will not notice when remote refs are updated during
> their foreground fetches. In fact, they may _want_ those refs to
> stay put so they can work with the refs from their last foreground
> fetch call.
>
> This can be accomplished by overriding the configured refspec using
> '--refmap=' along with a custom refspec:
>
> git fetch <remote> --refmap= +refs/heads/*:refs/hidden/<remote>/*
>
> 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:
>
> 1. We download a new pack if refs have updated.
> 2. Since the refs/hidden branches exist, GC will not remove the
> newly-downloaded data.
> 3. With fetch.writeCommitGraph enabled, the refs/hidden refs are
> used to update the commit-graph file.
>
> To avoid the refs/hidden directory from filling without bound, the
> --prune option can be included. When providing a refspec like this,
> the --prune option does not delete remote refs and instead only
> deletes refs in the target refspace.
>
> Update the documentation to clarify how '--refmap=""' works and
> create tests to guarantee this behavior remains in the future.
>
> Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
> ---
Thanks. Looks quite good.
Will queue.
prev parent reply other threads:[~2020-01-21 18:24 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
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 [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=xmqq1rrsbrc7.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.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).