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 12, 2020, 21:54 UTC
Message-ID
<20200712215433.cfjyqzaepsuktny2@chatter.i7.local>
In-Reply-To
<xmqqr1tgpibi.fsf@gitster.c.googlers.com>
On Sun, Jul 12, 2020 at 01:52:17PM -0700, Junio C Hamano wrote:
Show 20 quoted lines
> Konstantin Ryabitsev <konstantin@linuxfoundation.org> writes:
> 
> > I also discovered that symlinking FETCH_HEAD to /dev/null works as well 
> > and thus saves a few IO cycles.
> 
> We could teach "git fetch" a new "--write-fetch-head" option and
> teach "git pull" to pass it when calling "git fetch".  It is very
> plausible that some folks rely on "git fetch" to leave FETCH_HEAD
> without being told, so the option must default to on for a few
> development cycles before we flip the default to off, and for those
> who want to live in the future a bit earlier, we can also introduce
> fetch.writeFetchHEAD configuration variable that determines what
> happens when "git fetch" is run without "--write-fetch-head" option
> on the command line.  That way, you could drop 
> 
> 	[fetch]
> 		writeFetchHEAD = 0
> 
> in say /etc/gitconfig or in ~/.gitconfig of the user that runs the
> mirroring automation.

Yeah, that would be great for me. We can simply leave it on by default to preserve existing behaviour and just provide a way to disable writing it for those in fairly unique situations where that matters (like mine). One downside of symlinking it to /dev/null is that it creates a potential pitfall for software that expects FETCH_HEAD to always be a regular file and can behave unpredictably when it finds anything else there.

Thanks, -K

Previous: Junio C HamanoNext: Johannes Sixt
Message 7 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.