From: "Markus Mützel" <markus.muetzel@gmx.de>
To: bug-gnulib@gnu.org
Subject: Fetch from existing gnulib Git repository if needed
Date: Sat, 27 Apr 2024 17:11:02 +0200 [thread overview]
Message-ID: <trinity-a3b52577-3ebd-4415-92f0-7a893f021ae4-1714230662602@3c-app-gmx-bap45> (raw)
[-- Attachment #1: Type: text/plain, Size: 1391 bytes --]
Dear gnulib developers,
GNU Octave uses Mercurial as the VCS of its main repository.
Developers are using the bootstrap script of gnulib to automatically clone its Git repository in a subdirectory of Octave's source tree. The revision that we'd like to use is set in the bootstrap.conf script. Currently, that is
: ${GNULIB_REVISION=d4ec02b3cc70cddaaa5183cc5a45814e0afb2292}
This is working perfectly for a fresh clone of Octave's source tree. However, when we update GNULIB_REVISION to a newer revision and a user/developer ran the bootstrap script before, running the bootstrap script again fails with an error like the following:
./bootstrap: Bootstrapping from checked-out octave sources...
fatal: reference is not a tree: d4ec02b3cc70cddaaa5183cc5a45814e0afb2292
program finished with exit code 128
To work around that, a user/developer could manually fetch from the remote repository. That is a bit more tedious when it comes to CI installations that usually need no manual interaction.
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.
Would it be possible to make a similar change in gnulib so that updating to a newer gnulib revision becomes a bit easier for that configuration?
Markus
[-- Attachment #2: gnulib-bootstrap-git-fetch.diff --]
[-- Type: text/plain, Size: 774 bytes --]
Update bootstrap script from upstream gnulib to automatically fetch from repository if needed
diff -r c51b07a71421 bootstrap-funclib.sh
--- a/bootstrap-funclib.sh Fri Apr 26 13:33:37 2024 -0400
+++ b/bootstrap-funclib.sh Fri Apr 26 20:00:21 2024 +0200
@@ -532,6 +532,10 @@
# The subdirectory 'gnulib' already exists.
if test -n "$GNULIB_REVISION"; then
if test -d "$gnulib_path/.git"; then
+ if ! git --git-dir="$gnulib_path"/.git cat-file \
+ commit "$GNULIB_REVISION"; then
+ git --git-dir="$gnulib_path"/.git fetch
+ fi
(cd "$gnulib_path" && git checkout "$GNULIB_REVISION") || exit 1
else
die "Error: GNULIB_REVISION is specified in bootstrap.conf," \
next reply other threads:[~2024-04-27 15:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-27 15:11 Markus Mützel [this message]
2024-04-27 17:27 ` Fetch from existing gnulib Git repository if needed Bruno Haible
2024-04-28 9:14 ` Markus Mützel
2024-04-28 9:33 ` Bruno Haible
2024-04-29 6:19 ` Markus Mützel
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: https://lists.gnu.org/mailman/listinfo/bug-gnulib
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=trinity-a3b52577-3ebd-4415-92f0-7a893f021ae4-1714230662602@3c-app-gmx-bap45 \
--to=markus.muetzel@gmx.de \
--cc=bug-gnulib@gnu.org \
/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.
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).