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

Re: Are clone/checkout operations deterministic?

From
Jeff King <peff@peff.net>
Date
Jul 17, 2018, 19:52 UTC
Message-ID
<20180717195215.GA26218@sigill.intra.peff.net>
In-Reply-To
<87bmb6chvm.fsf@evledraar.gmail.com>
On Tue, Jul 17, 2018 at 11:48:45AM +0200, Ævar Arnfjörð Bjarmason wrote:
> In practice I think clone, checkout, reset etc. always work in the same
> order you see with `git ls-tree -r --name-only HEAD`, but as far as I
> know this has never been guaranteed or documented, and shouldn't be
> relied on.

I think this paragraph is correct in general (and I agree with the sentiment that this is subject to change in future versions).

There is one concrete case I know that has non-deterministic order in current versions: long-lived clean/smudge filters can defer their response. The LFS filter uses this to tell Git "no, I'm still downloading the content", at which point Git will proceed with checking out other local files (or even other LFS files that happen to arrive sooner).

Depending on what one wants to do with the determinism, it may be OK to ignore that case. ;)

-Peff
Previous: Duy Nguyen
Message 5 of 5 in “Are clone/checkout operations deterministic?”
  1. J. Paul ReedJul 17, 2018
  2. Ævar Arnfjörð BjarmasonJul 17, 2018
  3. Stefan BellerJul 17, 2018
  4. Duy NguyenJul 17, 2018
  5. Jeff KingJul 17, 2018

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.