Closed ssardina closed 5 months ago
I tried this, but it is a lot slower as it fetches all the submodules, also if their commit hash has not been changed. It seems to work better using
git pull --recurse-submodules=on-demand
But the command gets so long that I do not see the advantage any more.
git pull --recurse=on-demand
is a bit shorter than git pull && git submodule update --init
:)
(the option doesn't need to be fully spelled out but the value does)
And on my system, when things are up-to-date, git pull --recurse=yes
is 3.6 seconds.
Agree with @JanWielemaker , not worth it, definitively not worth it with yes
, too slow.
What about the fix I just did: leave the new extended pull with on-demand as a note?
@kamahen, just 3.6 cannot be, can it? Maybe you are just considering the user time, not not the wall time?
$ time git pull --recurse=yes
...
...
Fetching submodule packages/xpce
Fetching submodule packages/yaml
Fetching submodule packages/zlib
Already up to date.
git pull --recurse=yes 2.11s user 1.31s system 9% cpu 36.178 total
see wall time 36secs is way too much
What about the fix I just did: leave the new extended pull with on-demand as a note?
I don't see much point in that. Anyone can copy/paste as is and knowledgeable with git can do it otherwise. Why make it more complicated than that? Note that as-is, recursive pull does not deal with new modules, so you still need an extra instruction for that. It is in the bug list of git, so eventually it will be fixed (I guess).
Maybe both pull --recurse
and submodule update
are needed?
I just tried git pull
followed by git submodule update --init
(some of my submodules were already up-to-date):
$ git submodule update --init
Submodule path 'debian': checked out '892cfc2343f284c068f28e3d750ad37485b78176'
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 7 (delta 4), reused 7 (delta 4), pack-reused 0
Unpacking objects: 100% (7/7), 1.16 KiB | 132.00 KiB/s, done.
From github.com:SWI-Prolog/packages-http
91fca56..eb77751 master -> origin/master
* [new tag] V9.3.7 -> V9.3.7
Submodule path 'packages/http': checked out 'eb777510cc885090e721f26a2d6fd1e67fcd9366'
And then I did git pull --recurse
, and it did things that submodule init
missed:
$ git pull --recurse
Fetching submodule bench
From github.com:SWI-Prolog/bench
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule debian
From github.com:SWI-Prolog/distro-debian
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/PDT
From github.com:SWI-Prolog/packages-PDT
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/RDF
From github.com:SWI-Prolog/packages-RDF
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/archive
From github.com:SWI-Prolog/packages-archive
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/bdb
From github.com:SWI-Prolog/packages-bdb
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/chr
From github.com:SWI-Prolog/packages-chr
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/clib
From github.com:SWI-Prolog/packages-clib
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/clpqr
From github.com:SWI-Prolog/packages-clpqr
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/cpp
From github.com:SWI-Prolog/packages-cpp
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/cql
From github.com:SWI-Prolog/packages-cql
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/http
Fetching submodule packages/inclpr
From github.com:SWI-Prolog/packages-inclpr
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/jpl
From github.com:SWI-Prolog/packages-jpl
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/libedit
From github.com:SWI-Prolog/packages-libedit
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/ltx2htm
From github.com:SWI-Prolog/packages-ltx2htm
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/mqi
From github.com:SWI-Prolog/packages-mqi
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/nlp
From github.com:SWI-Prolog/packages-nlp
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/odbc
From github.com:SWI-Prolog/packages-odbc
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/paxos
From github.com:SWI-Prolog/packages-paxos
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/pcre
From github.com:SWI-Prolog/packages-pcre
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/pengines
From github.com:SWI-Prolog/packages-pengines
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/pldoc
From github.com:SWI-Prolog/packages-pldoc
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/plunit
From github.com:SWI-Prolog/packages-plunit
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/protobufs
From github.com:SWI-Prolog/contrib-protobufs
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/readline
From github.com:SWI-Prolog/packages-readline
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/redis
From github.com:SWI-Prolog/packages-redis
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/semweb
From github.com:SWI-Prolog/packages-semweb
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/sgml
From github.com:SWI-Prolog/packages-sgml
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/ssl
From github.com:SWI-Prolog/packages-ssl
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/stomp
From github.com:SWI-Prolog/packages-stomp
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/sweep
From github.com:SWI-Prolog/packages-sweep
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/swipl-win
From github.com:SWI-Prolog/packages-swipl-win
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/swipy
From github.com:SWI-Prolog/packages-swipy
* [new tag] V9.3.7 -> V9.3.7
* [new tag] janus-1.2.1 -> janus-1.2.1
* [new tag] janus-1.3.0 -> janus-1.3.0
Fetching submodule packages/table
From github.com:SWI-Prolog/packages-table
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/tipc
From github.com:SWI-Prolog/contrib-tipc
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/utf8proc
From github.com:SWI-Prolog/packages-utf8proc
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/windows
From github.com:SWI-Prolog/packages-windows
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/xpce
From github.com:SWI-Prolog/packages-xpce
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/yaml
From github.com:SWI-Prolog/packages-yaml
* [new tag] V9.3.7 -> V9.3.7
Fetching submodule packages/zlib
From github.com:SWI-Prolog/packages-zlib
* [new tag] V9.3.7 -> V9.3.7
Already up to date.
OK let us then leave it as is and don´t go into more details and subtleties. The init command is the de-facto standard, at least for now.. :-)
git pull
directly, as it is more modern