[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] bootstrap: When a commit hash is specified, do a shallow fet
Re: [PATCH] bootstrap: When a commit hash is specified, do a shallow fetch if possible
Sun, 24 Oct 2021 13:15:42 -0500
On Sat, 23 Oct 2021 00:20:32 +0200
Bruno Haible <firstname.lastname@example.org> wrote:
> Hi Glenn,
> > The gnulib sources are large but more importantly have lots of changes. So
> > initial checkout of the repository can take a long time when network or
> > cpu resources are limited. The later is especially acute in a non-KVM QEMU
> > virtual machine (which can take 40+ minutes compared to <30 seconds with
> > this change). The problem is specific to bootstrap configurations using
> > a specific gnulib revision specified by commit hash.
> The change looks reasonable, but is hardly self-explanatory. Could you please
> add parts of the commit message to comments in the code? So that one does
> not need to look in the git history in order to understand the code.
Are there specific parts of the commit message that you'd like to see
as comments? I'm thinking of replacing the current comment with
something along the lines of:
Git does not support cloning by commit hash. So attempt a shallow
fetch by commit hash to minimize the amount of data downloaded and
changes needed to be processed, which can drastically reduce download
and processing time for checkout. If the fetch by commit fails, a
shallow fetch can not be performed because we do not know what the
depth of the commit is without fetching all commits. So fallback to
fetching all commits.
> Also, I would expect that the GNULIB_REVISION environment variable is not
> so frequently used, and that the more frequent use is with git submodules.
> Is it possible to apply the same trick to the git submodules case? Or does
> the use of submodules always require a deep clone?
Honestly, I don't have much experience with or knowledge of submodules,
so I don't feel I can provide a good answer. I suspect that the answer
is that this trick can be used. I've not looked in to it because the
project that I'm working on does not use gnulib as a git submodule.