summaryrefslogtreecommitdiff
path: root/Documentation/git-fetch.txt
diff options
context:
space:
mode:
authorGlen Choo <chooglen@google.com>2022-03-08 00:14:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-03-16 23:08:59 (GMT)
commitb90d9f7632d380d3f16197ae657ab57075acd1eb (patch)
treea89794a4a8f9add7069a79d86e1854fff540d04f /Documentation/git-fetch.txt
parent5370b91f3fae9d7a511e23142b55082200152cef (diff)
downloadgit-b90d9f7632d380d3f16197ae657ab57075acd1eb.zip
git-b90d9f7632d380d3f16197ae657ab57075acd1eb.tar.gz
git-b90d9f7632d380d3f16197ae657ab57075acd1eb.tar.bz2
fetch: fetch unpopulated, changed submodules
"git fetch --recurse-submodules" only considers populated submodules (i.e. submodules that can be found by iterating the index), which makes "git fetch" behave differently based on which commit is checked out. As a result, even if the user has initialized all submodules correctly, they may not fetch the necessary submodule commits, and commands like "git checkout --recurse-submodules" might fail. Teach "git fetch" to fetch cloned, changed submodules regardless of whether they are populated. This is in addition to the current behavior of fetching populated submodules (which is always attempted regardless of what was fetched in the superproject, or even if nothing was fetched in the superproject). A submodule may be encountered multiple times (via the list of populated submodules or via the list of changed submodules). When this happens, "git fetch" only reads the 'populated copy' and ignores the 'changed copy'. Amend the verify_fetch_result() test helper so that we can assert on which 'copy' is being read. Signed-off-by: Glen Choo <chooglen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-fetch.txt')
-rw-r--r--Documentation/git-fetch.txt10
1 files changed, 4 insertions, 6 deletions
diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt
index 550c16c..e9d3646 100644
--- a/Documentation/git-fetch.txt
+++ b/Documentation/git-fetch.txt
@@ -287,12 +287,10 @@ include::transfer-data-leaks.txt[]
BUGS
----
-Using --recurse-submodules can only fetch new commits in already checked
-out submodules right now. When e.g. upstream added a new submodule in the
-just fetched commits of the superproject the submodule itself cannot be
-fetched, making it impossible to check out that submodule later without
-having to do a fetch again. This is expected to be fixed in a future Git
-version.
+Using --recurse-submodules can only fetch new commits in submodules that are
+present locally e.g. in `$GIT_DIR/modules/`. If the upstream adds a new
+submodule, that submodule cannot be fetched until it is cloned e.g. by `git
+submodule update`. This is expected to be fixed in a future Git version.
SEE ALSO
--------