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

Re: Concurrent fetch commands

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 3, 2024, 22:10 UTC
Message-ID
<xmqqwmsq83v3.fsf@gitster.g>
In-Reply-To
<ZZWOBObBmLW9Nid6@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
> ... I suppose the answer is that they expect
> concurrent fetches to be tolerated, but that the contents of FETCH_HEAD
> (and of course the remote references) are consistent at the end of all
> of the fetches.

What does it mean to be "consistent" in this case, though? For the controlled form of multiple fetches performed by "git fetch --all", the answer is probably "as if we fetched sequentially from these remotes, one by one, and concatenated what these individual fetch invocations left in FETCH_HEAD". But for an uncontrolled background fetch IDE and others perform behind user's back, it is unclear what it means, or for that matter, it is dubious if there is a reasonable definition for the word.

Folks who invented "git maintenance" designed their "prefetch" task to perform the best practice, without interfering any foreground fetches by not touching FETCH_HEAD and the remote-tracking branches.

Nobody brought up the latter so far on this discussion thread, but mucking with the remote-tracking branches behind user's back means completely breaking the end-user expectation that --force-with-lease would do something useful even when it is not given the commit the user expects to see at the remote. Perhaps those third-party tools that want to run "git fetch" in the background can learn from how "prefetch" task works to avoid the breakage they are inflicting on their users?

Previous: Taylor BlauNext: Stefan Haller
Message 15 of 20 in “Concurrent fetch commands”
  1. Stefan HallerDec 31, 2023
  2. Dragan SimicDec 31, 2023
  3. Konstantin TokarevDec 31, 2023
  4. Dragan SimicDec 31, 2023
  5. Stefan HallerJan 1, 2024
  6. Federico KircheisJan 1, 2024
  7. Junio C HamanoDec 31, 2023
  8. Dragan SimicDec 31, 2023
  9. Stefan HallerJan 1, 2024
  10. Stefan HallerJan 1, 2024
  11. Patrick SteinhardtJan 3, 2024
  12. Patrick SteinhardtJan 3, 2024
  13. Patrick SteinhardtJan 3, 2024
  14. Taylor BlauJan 3, 2024
  15. Junio C HamanoJan 3, 2024
  16. Stefan HallerJan 4, 2024
  17. Mike HommeyJan 4, 2024
  18. Junio C HamanoJan 4, 2024
  19. Mike HommeyJan 4, 2024
  20. Taylor BlauJan 4, 2024

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.