From: Stefan Beller <sbeller@google.com>
To: gitster@pobox.com
Cc: git@vger.kernel.org, Stefan Beller <sbeller@google.com>
Subject: [PATCH 0/9] Resending sb/submodule-recursive-fetch-gets-the-tip
Date: Tue, 16 Oct 2018 11:13:18 -0700 [thread overview]
Message-ID: <20181016181327.107186-1-sbeller@google.com> (raw)
This is based on ao/submodule-wo-gitmodules-checked-out.
This resends origin/sb/submodule-recursive-fetch-gets-the-tip, resolving
the issues pointed out via origin/xxx/sb-submodule-recursive-fetch-gets-the-tip-in-pu
by basing this series on origin/ao/submodule-wo-gitmodules-checked-out
A range-diff below shows how picking a different base changed the patches,
apart from that no further adjustments have been made.
Thanks,
Stefan
Stefan Beller (9):
sha1-array: provide oid_array_filter
submodule.c: fix indentation
submodule.c: sort changed_submodule_names before searching it
submodule.c: move global changed_submodule_names into fetch submodule
struct
submodule.c: do not copy around submodule list
repository: repo_submodule_init to take a submodule struct
submodule: fetch in submodules git directory instead of in worktree
fetch: retry fetching submodules if needed objects were not fetched
builtin/fetch: check for submodule updates for non branch fetches
Documentation/technical/api-oid-array.txt | 5 +
builtin/fetch.c | 14 +-
builtin/grep.c | 17 +-
builtin/ls-files.c | 12 +-
repository.c | 27 +-
repository.h | 11 +-
sha1-array.c | 17 ++
sha1-array.h | 3 +
submodule.c | 275 +++++++++++++++----
t/helper/test-submodule-nested-repo-config.c | 8 +-
t/t5526-fetch-submodules.sh | 23 +-
11 files changed, 315 insertions(+), 97 deletions(-)
git range-diff origin/xxx/sb-submodule-recursive-fetch-gets-the-tip-in-pu...
[...]
585: ac1f98a0df < -: ---------- doc: move git-rev-parse from porcelain to plumbing
586: 7cf1a0fbef = 1: a035323c49 sha1-array: provide oid_array_filter
587: 01077381d0 = 2: 30ed20b4f0 submodule.c: fix indentation
588: 4b0cdf5899 = 3: cd590ea88d submodule.c: sort changed_submodule_names before searching it
589: 78e5099ecc ! 4: ce959811ba submodule.c: move global changed_submodule_names into fetch submodule struct
@@ -12,7 +12,7 @@
--- a/submodule.c
+++ b/submodule.c
@@
- #include "commit-reach.h"
+ #include "object-store.h"
static int config_update_recurse_submodules = RECURSE_SUBMODULES_OFF;
-static struct string_list changed_submodule_names = STRING_LIST_INIT_DUP;
590: d813f18bb3 = 5: 151f9a8ad4 submodule.c: do not copy around submodule list
591: a077d63af7 ! 6: 3a97743fa2 repository: repo_submodule_init to take a submodule struct
@@ -15,7 +15,6 @@
Also move its documentation into the header file.
Signed-off-by: Stefan Beller <sbeller@google.com>
- Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff --git a/builtin/grep.c b/builtin/grep.c
--- a/builtin/grep.c
@@ -31,12 +30,16 @@
+
int hit;
- if (!is_submodule_active(superproject, path))
+ /*
+@@
return 0;
+ }
-- if (repo_submodule_init(&submodule, superproject, path))
-+ if (repo_submodule_init(&subrepo, superproject, sub))
+- if (repo_submodule_init(&submodule, superproject, path)) {
++ if (repo_submodule_init(&subrepo, superproject, sub)) {
+ grep_read_unlock();
return 0;
+ }
- repo_read_gitmodules(&submodule);
+ repo_read_gitmodules(&subrepo);
@@ -44,9 +47,9 @@
/*
* NEEDSWORK: This adds the submodule's object directory to the list of
@@
+ * store is no longer global and instead is a member of the repository
* object.
*/
- grep_read_lock();
- add_to_alternates_memory(submodule.objects->objectdir);
+ add_to_alternates_memory(subrepo.objects->objectdir);
grep_read_unlock();
@@ -100,19 +103,6 @@
static void show_ce(struct repository *repo, struct dir_struct *dir,
-diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
---- a/builtin/submodule--helper.c
-+++ b/builtin/submodule--helper.c
-@@
- if (!sub)
- BUG("We could get the submodule handle before?");
-
-- if (repo_submodule_init(&subrepo, the_repository, path))
-+ if (repo_submodule_init(&subrepo, the_repository, sub))
- die(_("could not get a repository handle for submodule '%s'"), path);
-
- if (!repo_config_get_string(&subrepo, "core.worktree", &cw)) {
-
diff --git a/repository.c b/repository.c
--- a/repository.c
+++ b/repository.c
@@ -197,3 +187,32 @@
void repo_clear(struct repository *repo);
/*
+
+diff --git a/t/helper/test-submodule-nested-repo-config.c b/t/helper/test-submodule-nested-repo-config.c
+--- a/t/helper/test-submodule-nested-repo-config.c
++++ b/t/helper/test-submodule-nested-repo-config.c
+@@
+
+ int cmd__submodule_nested_repo_config(int argc, const char **argv)
+ {
+- struct repository submodule;
++ struct repository subrepo;
++ const struct submodule *sub;
+
+ if (argc < 3)
+ die_usage(argc, argv, "Wrong number of arguments.");
+
+ setup_git_directory();
+
+- if (repo_submodule_init(&submodule, the_repository, argv[1])) {
++ sub = submodule_from_path(the_repository, &null_oid, argv[1]);
++ if (repo_submodule_init(&subrepo, the_repository, sub)) {
+ die_usage(argc, argv, "Submodule not found.");
+ }
+
+ /* Read the config of _child_ submodules. */
+- print_config_from_gitmodules(&submodule, argv[2]);
++ print_config_from_gitmodules(&subrepo, argv[2]);
+
+ submodule_free(the_repository);
+
592: 780f6c1a92 = 7: 4e8ad61f8d submodule: fetch in submodules git directory instead of in worktree
593: a530535912 = 8: 24bac00db7 fetch: retry fetching submodules if needed objects were not fetched
594: a72bde3a8a = 9: e031182e44 builtin/fetch: check for submodule updates for non branch fetches
[...]
next reply other threads:[~2018-10-16 18:13 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-16 18:13 Stefan Beller [this message]
2018-10-16 18:13 ` [PATCH 1/9] sha1-array: provide oid_array_filter Stefan Beller
2018-10-16 18:13 ` [PATCH 2/9] submodule.c: fix indentation Stefan Beller
2018-10-16 18:13 ` [PATCH 3/9] submodule.c: sort changed_submodule_names before searching it Stefan Beller
2018-10-17 21:21 ` Jonathan Tan
2018-10-16 18:13 ` [PATCH 4/9] submodule.c: move global changed_submodule_names into fetch submodule struct Stefan Beller
2018-10-17 21:26 ` Jonathan Tan
2018-10-18 19:09 ` Stefan Beller
2018-10-16 18:13 ` [PATCH 5/9] submodule.c: do not copy around submodule list Stefan Beller
2018-10-17 21:45 ` Jonathan Tan
2018-10-18 2:35 ` Junio C Hamano
2018-10-16 18:13 ` [PATCH 6/9] repository: repo_submodule_init to take a submodule struct Stefan Beller
2018-10-17 21:55 ` Jonathan Tan
2018-10-16 18:13 ` [PATCH 7/9] submodule: fetch in submodules git directory instead of in worktree Stefan Beller
2018-10-17 22:58 ` Jonathan Tan
2018-10-23 18:26 ` Stefan Beller
2018-10-23 22:55 ` Jonathan Tan
2018-10-23 23:01 ` Stefan Beller
2018-10-16 18:13 ` [PATCH 8/9] fetch: retry fetching submodules if needed objects were not fetched Stefan Beller
2018-10-18 0:39 ` Jonathan Tan
2018-10-23 22:37 ` Stefan Beller
2018-10-23 23:37 ` Jonathan Tan
2018-10-25 21:42 ` Stefan Beller
2018-10-16 18:13 ` [PATCH 9/9] builtin/fetch: check for submodule updates for non branch fetches Stefan Beller
2018-10-18 0:47 ` Jonathan Tan
2018-10-18 2:30 ` [PATCH 0/9] Resending sb/submodule-recursive-fetch-gets-the-tip Junio C Hamano
2018-10-18 7:30 ` Junio C Hamano
2018-10-18 18:00 ` Stefan Beller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181016181327.107186-1-sbeller@google.com \
--to=sbeller@google.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).