summaryrefslogtreecommitdiff
path: root/git-pull.sh
diff options
context:
space:
mode:
authorNicolas Morey-Chaisemartin <nicolas.morey@free.fr>2011-03-30 05:20:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-03-31 00:34:08 (GMT)
commit313ee0d69f58c2bf2f4e0a62b812c9d08a39b240 (patch)
tree2c774c3458f022aeb1285f0686dd3ec5f26469eb /git-pull.sh
parent806e0aba2e5d976233703e6ff517af10329e4048 (diff)
downloadgit-313ee0d69f58c2bf2f4e0a62b812c9d08a39b240.zip
git-313ee0d69f58c2bf2f4e0a62b812c9d08a39b240.tar.gz
git-313ee0d69f58c2bf2f4e0a62b812c9d08a39b240.tar.bz2
submodule: process conflicting submodules only once
During a merge module_list returns conflicting submodules several times (stage 1,2,3) which caused the submodules to be used multiple times in git submodule init, sync, update and status command. There are 5 callers of module_list; they all read (mode, sha1, stage, path) tuple, and most of them care only about path. As a first level approximation, it should be Ok (in the sense that it does not make things worse than it currently is) to filter the duplicate paths from module_list output, but some callers should change their behaviour when the merge in the superproject still has conflicts. Notice the higher-stage entries, and emit only one record from module_list, but while doing so, mark the entry with "U" (not [0-3]) in the $stage field and null out the SHA-1 part, as the object name for the lowest stage does not give any useful information to the caller, and this way any caller that uses the object name would hopefully barf. Then update the codepaths for each subcommands this way: - "update" should not touch the submodule repository, because we do not know what commit should be checked out yet. - "status" reports the conflicting submodules as 'U000...000' and does not recurse into them (we might later want to make it recurse). - The command called by "foreach" may want to do whatever it wants to do by noticing the merged status in the superproject itself, so feed the path to it from module_list as before, but only once per submodule. - "init" and "sync" are unlikely things to do while the superproject is still not merged, but as long as a submodule is there in $path, there is no point skipping it. It might however want to take the merged status of .gitmodules into account, but that is outside of the scope of this topic. Acked-by: Jens Lehmann <Jens.Lehmann@web.de> Thanks-to: Junio C Hamano <gitster@pobox.com> Signed-off-by: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-pull.sh')
0 files changed, 0 insertions, 0 deletions