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

Re: FETCH_HEAD files and mirrored repos

From
Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Date
Jul 13, 2020, 20:34 UTC
Message-ID
<20200713203427.apajagayqx4gpadf@chatter.i7.local>
In-Reply-To
<20200713202211.GA2355588@coredump.intra.peff.net>
On Mon, Jul 13, 2020 at 04:22:11PM -0400, Jeff King wrote:
Show 19 quoted lines
> I occasionally use FETCH_HEAD for such things. If we were to stop
> writing it automatically, I think the key thing to notice is whether the
> result was actually stored anywhere else. Or more accurately, whether
> the user asked for any refspecs on the command line (since we'd still
> update tracking refs in some cases).
> 
> If I do:
> 
>   git fetch
> 
> or:
> 
>   git fetch origin refs/heads/foo:refs/heads/foo
> 
> then I probably don't care about FETCH_HEAD. But if I do:
> 
>   git fetch origin refs/heads/foo
> 
> then I'm probably interested in picking the result out of FETCH_HEAD.

I think adding all this logic is not worth the effort. For vast numbers of people who aren't running Android mirrors, FETCH_HEAD is only going to be a few KB in size, so they won't benefit from this change at all.

I'm happy with just an option that I have to enable to turn off writing FETCH_HEAD.

-K
Previous: Jeff KingNext: Jeff King
Message 16 of 19 in “FETCH_HEAD files and mirrored repos”
  1. Konstantin RyabitsevJul 11, 2020
  2. Junio C HamanoJul 11, 2020
  3. Konstantin RyabitsevJul 11, 2020
  4. Junio C HamanoJul 12, 2020
  5. Konstantin RyabitsevJul 12, 2020
  6. Junio C HamanoJul 12, 2020
  7. Konstantin RyabitsevJul 12, 2020
  8. Johannes SixtJul 13, 2020
  9. Junio C HamanoJul 13, 2020
  10. fetch: optionally allow disabling FETCH_HEAD updateJunio C Hamano, Jul 13, 2020
  11. Taylor BlauJul 13, 2020
  12. Junio C HamanoJul 13, 2020
  13. Konstantin RyabitsevJul 13, 2020
  14. Junio C HamanoJul 13, 2020
  15. Jeff KingJul 13, 2020
  16. Konstantin RyabitsevJul 13, 2020
  17. Jeff KingJul 13, 2020
  18. Johannes SixtJul 13, 2020
  19. Jonathan NiederJul 14, 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.