URL:
  <https://savannah.gnu.org/bugs/?66357>

                 Summary: Bootstrap script clone gnulib always with full
history.
                   Group: GNU GRUB
               Submitter: hetii
               Submitted: Sat 19 Oct 2024 05:10:58 PM UTC
                Category: Compilation
                Severity: Major
                Priority: 5 - Normal
              Item Group: Software Error
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: Git master
                 Release: 
         Reproducibility: Every Time
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Sat 19 Oct 2024 05:10:58 PM UTC By: hetii <hetii>
Hello.

I notice that original bootstrap script grep by '--depth' parameter to check
if git is able clone gnulib in shallow mode.

eg:
        git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth
2'
        git fetch -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth
2'

This checks is always false for current git version at least in ubuntu images
as the argument seams to be now:

        --[no-]depth <depth>  deepen history of shallow clone

As a result, gnulib is always cloned with full history (139MB).

For workaround I use sed to use regex instead.

        sed -i -e s/'-- --depth'/'-E -- \'\''--\(\\[no-\\]\)?depth'\'/g
bootstrap

Then, the original lines are change to:
        git clone -h 2>&1 | grep -E -- '--(\[no-\])?depth' > /dev/null &&
shallow='--depth 2'
        git fetch -h 2>&1 | grep -E -- '--(\[no-\])?depth' > /dev/null &&
shallow='--depth 2'

Now the grep regex support '--depth' as well as '--[no-]depth'.

By this small change gnulib size is reduced to 84MB and clone a bit faster.

I'm only not sure why shallow is set to '--depth 2' instead '--depth 1' by
default.

Regards.







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66357>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to