From e319c0feea5088fe7774f44919756a54e963d1ac Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 16 Feb 2025 13:43:40 +0100 Subject: [PATCH] bootstrap: Fix recognition of --depth option with recent git releases. Reported by Benno Schulenberg in . * top/bootstrap-funclib.sh (prepare_GNULIB_SRCDIR): Assume that 'git clone' and 'git fetch' support the --depth option. * build-aux/bootstrap: Regenerated. --- ChangeLog | 9 +++++++++ build-aux/bootstrap | 10 ++-------- top/bootstrap-funclib.sh | 10 ++-------- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0df514ecf..c949a1385d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2025-02-16 Bruno Haible + + bootstrap: Fix recognition of --depth option with recent git releases. + Reported by Benno Schulenberg in + . + * 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 toupper_l: Add tests. diff --git a/build-aux/bootstrap b/build-aux/bootstrap index 2d174cedbd..fef3cbcd37 100755 --- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -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. # @@ -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 diff --git a/top/bootstrap-funclib.sh b/top/bootstrap-funclib.sh index 1ad3d85a41..47e015bd24 100644 --- a/top/bootstrap-funclib.sh +++ b/top/bootstrap-funclib.sh @@ -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. # @@ -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