author | Jens Lehmann <Jens.Lehmann@web.de> | |
Fri, 12 Nov 2010 12:54:52 +0000 (13:54 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 12 Nov 2010 23:06:03 +0000 (15:06 -0800) | ||
commit | 7dce19d374a37932e9d4c3a6202af407cf5114eb | |
tree | 4e26a11bba6c571c41fef1e625f61edfa62cbb12 | tree | snapshot |
parent | 515cc0101943b766fde7aa894827119e332ec033 | commit | diff |
fetch/pull: Add the --recurse-submodules option
Until now you had to call "git submodule update" (without -N|--no-fetch
option) or something like "git submodule foreach git fetch" to fetch
new commits in populated submodules from their remote.
This could lead to "(commits not present)" messages in the output of
"git diff --submodule" (which is used by "git gui" and "gitk") after
fetching or pulling new commits in the superproject and is an obstacle for
implementing recursive checkout of submodules. Also "git submodule
update" cannot fetch changes when disconnected, so it was very easy to
forget to fetch the submodule changes before disconnecting only to
discover later that they are needed.
This patch adds the "--recurse-submodules" option to recursively fetch
each populated submodule from the url configured in the .git/config of the
submodule at the end of each "git fetch" or during "git pull" in the
superproject. The submodule paths are taken from the index.
The hidden option "--submodule-prefix" is added to "git fetch" to be able
to print out the full paths of nested submodules.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Until now you had to call "git submodule update" (without -N|--no-fetch
option) or something like "git submodule foreach git fetch" to fetch
new commits in populated submodules from their remote.
This could lead to "(commits not present)" messages in the output of
"git diff --submodule" (which is used by "git gui" and "gitk") after
fetching or pulling new commits in the superproject and is an obstacle for
implementing recursive checkout of submodules. Also "git submodule
update" cannot fetch changes when disconnected, so it was very easy to
forget to fetch the submodule changes before disconnecting only to
discover later that they are needed.
This patch adds the "--recurse-submodules" option to recursively fetch
each populated submodule from the url configured in the .git/config of the
submodule at the end of each "git fetch" or during "git pull" in the
superproject. The submodule paths are taken from the index.
The hidden option "--submodule-prefix" is added to "git fetch" to be able
to print out the full paths of nested submodules.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/fetch-options.txt | diff | blob | history | |
builtin/fetch.c | diff | blob | history | |
git-pull.sh | diff | blob | history | |
submodule.c | diff | blob | history | |
submodule.h | diff | blob | history | |
t/t5526-fetch-submodules.sh | [new file with mode: 0755] | blob |