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

Re: [PATCH v2] fetch: document and test --refmap=""

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 21, 2020, 18:24 UTC
Message-ID
<xmqq1rrsbrc7.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<pull.532.v2.git.1579570692766.gitgitgadget@gmail.com>
"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 35 quoted lines
> 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.
Previous: Junio C Hamano
Message 13 of 13 in “fetch: add --no-update-remote-refs”
  1. fetch: add --no-update-remote-refsDerrick Stolee via GitGitGadget, Jan 17, 2020
  2. Eric SunshineJan 17, 2020
  3. Junio C HamanoJan 17, 2020
  4. Jeff KingJan 17, 2020
  5. Derrick StoleeJan 20, 2020
  6. Jeff KingJan 17, 2020
  7. Derrick StoleeJan 21, 2020
  8. fetch: document and test --refmap=""Derrick Stolee via GitGitGadget, Jan 21, 2020
  9. Jeff KingJan 21, 2020
  10. Derrick StoleeJan 21, 2020
  11. Jeff KingJan 21, 2020
  12. Junio C HamanoJan 21, 2020
  13. Junio C HamanoJan 21, 2020

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.