Hi,
On 06 Aug 2023 at 16:56:45, Bruno Haible wrote: > Carles Pina i Estany wrote: > > When I say "long time" (and data transmission) in my case it's 9 > > minutes: > > ----- > > carles@pinux:[master]~/git/wget2$ time git submodule update --init > > Cloning into '/home/carles/git/wget2/gnulib'... > > Submodule path 'gnulib': checked out > > '2ae6faf9c78384dc6a2674b62dd56ff153cd51f6' > > > > real 9m1,135s > > user 6m24,309s > > sys 0m5,020s > > ----- above was with a 4G+ connection and a laptop > I can reproduce that the --depth option has a big impact on the > 'git clone' execution time: > > - no --depth: 50 sec. > - --depth=2000: 16 sec. > - --depth=1: 5 sec. In my day to day VPS server (low spec): - no --depth: 6 minutes (majority of time in "resolving deltas") (152 MB in the cloned directory) - --depth=2000: 1 min 30 sec (100 MB) - --depth=1: 7 seconds (88 MB) > However, --depth=1 has the problem that it may/will cause trouble to the > developer later, if they use more than "git pull". Namely, > - In 'git log' the history will be truncated, > - 'git bisect' may not work, > - 'git annotate' will show a wrong author for many lines of code. > > '--depth=2000' would be a middle ground, but it still has the 'git annotate' > problem. agree with above > These troubles are probably not worth the saved 'git clone' time upfront. > > However, when doing automated builds, such as continuous integration, > --depth=1 saves a lot of time, and is not problematic, since the build > directory is getting deleted anyway 10 minutes later. > > How about adding to 'bootstrap' an option '--for-build' that has the > effect that all submodule clones will be fetched with --depth=1 ? >From my initial point of view (slower connections, metered connections) and also for saving CI building time and bandwidth (and git.savannah.gnu.org bandwidth): an option '--for-build' seems very useful. Thanks for considering it, -- Carles Pina i Estany https://carles.pina.cat || Wiktionary translations: https://kamus.pina.cat