From: Stefan Beller <sbeller@google.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Ben Peart" <peartben@gmail.com>
Cc: preed@sigkill.com, git <git@vger.kernel.org>
Subject: Re: Are clone/checkout operations deterministic?
Date: Tue, 17 Jul 2018 10:58:30 -0700 [thread overview]
Message-ID: <CAGZ79kbJkocY0oe2_efEA3s0dGgR4tnvwpvUTNuJuSSYY=MazQ@mail.gmail.com> (raw)
In-Reply-To: <87bmb6chvm.fsf@evledraar.gmail.com>
On Tue, Jul 17, 2018 at 2:48 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
>
>
> On Tue, Jul 17 2018, J. Paul Reed wrote:
>
> > Hey Git Devs,
> >
> > I have a bit of an odd question: do git clone/checkout operations have a
> > deterministic ordering?
> >
> > That is: are files guaranteed to be laid down onto disk in any specific
> > (and deterministic) order as a clone and/or checkout operations occurs?
> > (And if so, is it alphabetical order? Depth-first? Something else?)
> >
> > In case the answer is different (and I'd guess that it might be?), I'm
> > mostly interested in the initial clone case... but it would be great to
> > know if, indeed, the answer is different for just-checkouts too.
> >
> > I did some cursory googling, but nothing hopped out at me as an answer to
> > this question.
>
> 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.
The transmission of packfiles is non-deterministic, as the packfiles
(which are packed for each clone separately when using core git as
a server) are not packed in a deterministic fashion, but in a threaded
environment which allows different packing orders.
If you clone from a server that gives you exactly the same pack at
all times (assuming the remote repo doesn't change refs), then
checkout is currently deterministic in unpacking files to the working tree.
>
> E.g. there's probably cases where writing files in parallel is going to
> be faster than writing them sequentially. We don't have such a mode just
> because nobody's written a patch for it, but having that patch would
> break any assumptions of our current order.
+cc Ben who is looking into that, but hasn't spoken up on the mailing list yet.
next prev parent reply other threads:[~2018-07-17 17:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-17 9:14 Are clone/checkout operations deterministic? J. Paul Reed
2018-07-17 9:48 ` Ævar Arnfjörð Bjarmason
2018-07-17 17:58 ` Stefan Beller [this message]
2018-07-17 18:06 ` Duy Nguyen
2018-07-17 19:52 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGZ79kbJkocY0oe2_efEA3s0dGgR4tnvwpvUTNuJuSSYY=MazQ@mail.gmail.com' \
--to=sbeller@google.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=peartben@gmail.com \
--cc=preed@sigkill.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).