Skip to content

Commit

Permalink
bootstrap: Fix recognition of --depth option with recent git releases.
Browse files Browse the repository at this point in the history
Reported by Benno Schulenberg <[email protected]> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-02/msg00106.html>.

* top/bootstrap-funclib.sh (prepare_GNULIB_SRCDIR): Assume that
'git clone' and 'git fetch' support the --depth option.
* build-aux/bootstrap: Regenerated.
  • Loading branch information
bhaible committed Feb 16, 2025
1 parent a0b4542 commit e319c0f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2025-02-16 Bruno Haible <[email protected]>

bootstrap: Fix recognition of --depth option with recent git releases.
Reported by Benno Schulenberg <[email protected]> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-02/msg00106.html>.
* top/bootstrap-funclib.sh (prepare_GNULIB_SRCDIR): Assume that
'git clone' and 'git fetch' support the --depth option.
* build-aux/bootstrap: Regenerated.

2025-02-16 Bruno Haible <[email protected]>

toupper_l: Add tests.
Expand Down
10 changes: 2 additions & 8 deletions build-aux/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ medir=`dirname "$me"`

# A library of shell functions for autopull.sh, autogen.sh, and bootstrap.

scriptlibversion=2025-02-04.01; # UTC
scriptlibversion=2025-02-16.12; # UTC

# Copyright (C) 2003-2025 Free Software Foundation, Inc.
#
Expand Down Expand Up @@ -580,17 +580,11 @@ prepare_GNULIB_SRCDIR ()
|| cleanup_gnulib
else
# GNULIB_REFDIR is not set or not usable. Ignore it.
shallow=
shallow='--depth 2'
if test -z "$GNULIB_REVISION"; then
if git clone -h 2>&1 | grep -- --depth > /dev/null; then
shallow='--depth 2'
fi
git clone $shallow "$gnulib_url" "$gnulib_path" \
|| cleanup_gnulib
else
if git fetch -h 2>&1 | grep -- --depth > /dev/null; then
shallow='--depth 2'
fi
# Only want a shallow checkout of $GNULIB_REVISION, but 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
Expand Down
10 changes: 2 additions & 8 deletions top/bootstrap-funclib.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# A library of shell functions for autopull.sh, autogen.sh, and bootstrap.

scriptlibversion=2025-02-04.01; # UTC
scriptlibversion=2025-02-16.12; # UTC

# Copyright (C) 2003-2025 Free Software Foundation, Inc.
#
Expand Down Expand Up @@ -543,17 +543,11 @@ prepare_GNULIB_SRCDIR ()
|| cleanup_gnulib
else
# GNULIB_REFDIR is not set or not usable. Ignore it.
shallow=
shallow='--depth 2'
if test -z "$GNULIB_REVISION"; then
if git clone -h 2>&1 | grep -- --depth > /dev/null; then
shallow='--depth 2'
fi
git clone $shallow "$gnulib_url" "$gnulib_path" \
|| cleanup_gnulib
else
if git fetch -h 2>&1 | grep -- --depth > /dev/null; then
shallow='--depth 2'
fi
# Only want a shallow checkout of $GNULIB_REVISION, but 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
Expand Down

0 comments on commit e319c0f

Please sign in to comment.