[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fetch from existing gnulib Git repository if needed
From: |
Markus Mützel |
Subject: |
Re: Fetch from existing gnulib Git repository if needed |
Date: |
Sun, 28 Apr 2024 11:14:12 +0200 |
Hi Bruno,
> > As a workaround we are applying the attached patch to the
> > bootstrap-funclib.sh script to automatically fetch from the remote gnulib
> > repository if the GNULIB_REVISION isn't found in the local gnulib Git
> > repository.
>
> Thanks for the patch. But note that GNULIB_REVISION can hold either a commit
> hash or the name of a branch (such as 'stable-202401'). So, we have 4 cases:
> (a) a commit hash, already present
> (b) a commit hash, not known
> (c) a branch, already present
> (d) a branch, not known
>
> The command 'git cat-file commit $GNULIB_REVISION' returns true in the cases
> (a) and (c). So, your patch would trigger a 'git fetch' in the cases (b) and
> (d). But in case (d), the 'git fetch' is useless:
> 'git cat-file commit $GNULIB_REVISION' would still fail afterwards.
>
> One can distinguish the four cases in more detail using the commands
> git rev-list --quiet $GNULIB_REVISION --
> which tests for case (a) and
> git show-ref --verify --quiet refs/heads/$GNULIB_REVISION
> which tests for case (c). This would allow us to do 'git fetch' only in case
> (b).
>
> However, I believe the patch below is simpler and achieves the same goal.
Thank you for looking into this. However, it looks like $GNULIB_SRCDIR is empty
for us. So, the change doesn't seem to make a difference. Executing bootstrap
after a revision bump still fails if the bootstrap script was already run
before.
I like your idea of fetching if the checkout failed though.
The attached diff seems to be working for our use case. Would it be possible to
apply something like that in gnulib?
Markus
gnulib-bootstrap-git-fetch-v2.diff
Description: Text document