{"thread":{"id":"49678","subject":"[PATCH v7 01/10] submodule: add a print_config_from_gitmodules() helper","startedAt":"2018-10-25T16:18:32Z","lastAt":"2018-10-31T06:01:18Z","messageCount":17,"participants":["Antonio Ospite","Stefan Beller","Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":7,"patchTotal":10},"messages":[{"id":"361523","messageId":"20181025161813.17252-2-ao2@ao2.it","threadId":"49678","inReplyTo":"20181025161813.17252-1-ao2@ao2.it","subject":"[PATCH v7 01/10] submodule: add a print_config_from_gitmodules() helper","fromName":"Antonio Ospite","fromEmail":"ao2@ao2.it","sentAt":"2018-10-25T16:18:04Z","receivedAt":"2018-10-25T16:18:32Z","isPatch":true,"sender":{"key":"ao2@ao2.it","avatar":"https://avatars.githubusercontent.com/u/1249395?v=4"},"body":"Add a new print_config_from_gitmodules() helper function to print values\nfrom .gitmodules just like \"git config -f .gitmodules\" would.\n\nThis will be used by a new submodule--helper subcommand to be able to\naccess the .gitmodules file in a more controlled way.\n\nSigned-off-by: Antonio Ospite <ao2@ao2.it>\n---\n submodule-config.c | 25 +++++++++++++++++++++++++\n submodule-config.h |  1 +\n 2 files changed, 26 insertions(+)\n\ndiff --git a/submodule-config.c b/submodule-config.c\nindex b132f7a80b..e36d4e2271 100644\n--- a/submodule-config.c\n+++ b/submodule-config.c\n@@ -692,6 +692,31 @@ void submodule_free(struct repository *r)\n \t\tsubmodule_cache_clear(r->submodule_cache);\n }\n \n+static int config_print_callback(const char *var, const char *value, void *cb_data)\n+{\n+\tchar *wanted_key = cb_data;\n+\n+\tif (!strcmp(wanted_key, var))\n+\t\tprintf(\"%s\\n\", value);\n+\n+\treturn 0;\n+}\n+\n+int print_config_from_gitmodules(struct repository *repo, const char *key)\n+{\n+\tint ret;\n+\tchar *store_key;\n+\n+\tret = git_config_parse_key(key, &store_key, NULL);\n+\tif (ret < 0)\n+\t\treturn CONFIG_INVALID_KEY;\n+\n+\tconfig_from_gitmodules(config_print_callback, repo, store_key);\n+\n+\tfree(store_key);\n+\treturn 0;\n+}\n+\n struct fetch_config {\n \tint *max_children;\n \tint *recurse_submodules;\ndiff --git a/submodule-config.h b/submodule-config.h\nindex dc7278eea4..031747ccf8 100644\n--- a/submodule-config.h\n+++ b/submodule-config.h\n@@ -48,6 +48,7 @@ const struct submodule *submodule_from_path(struct repository *r,\n \t\t\t\t\t    const struct object_id *commit_or_tree,\n \t\t\t\t\t    const char *path);\n void submodule_free(struct repository *r);\n+int print_config_from_gitmodules(struct repository *repo, const char *key);\n \n /*\n  * Returns 0 if the name is syntactically acceptable as a submodule \"name\"\n-- \n2.19.1\n\n"},{"id":"361524","messageId":"20181025161813.17252-6-ao2@ao2.it","threadId":"49678","inReplyTo":"20181025161813.17252-1-ao2@ao2.it","subject":"[PATCH v7 05/10] submodule--helper: add a new 'config' subcommand","fromName":"Antonio Ospite","fromEmail":"ao2@ao2.it","sentAt":"2018-10-25T16:18:08Z","receivedAt":"2018-10-25T16:18:32Z","isPatch":true,"sender":{"key":"ao2@ao2.it","avatar":"https://avatars.githubusercontent.com/u/1249395?v=4"},"body":"Add a new 'config' subcommand to 'submodule--helper', this extra level\nof indirection makes it possible to add some flexibility to how the\nsubmodules configuration is handled.\n\nSigned-off-by: Antonio Ospite <ao2@ao2.it>\n---\n builtin/submodule--helper.c | 14 ++++++++++++++\n t/t7411-submodule-config.sh | 27 +++++++++++++++++++++++++++\n 2 files changed, 41 insertions(+)\n\ndiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\nindex 80474c3ff5..9af6626e32 100644\n--- a/builtin/submodule--helper.c\n+++ b/builtin/submodule--helper.c\n@@ -2126,6 +2126,19 @@ static int check_name(int argc, const char **argv, const char *prefix)\n \treturn 0;\n }\n \n+static int module_config(int argc, const char **argv, const char *prefix)\n+{\n+\t/* Equivalent to ACTION_GET in builtin/config.c */\n+\tif (argc == 2)\n+\t\treturn print_config_from_gitmodules(the_repository, argv[1]);\n+\n+\t/* Equivalent to ACTION_SET in builtin/config.c */\n+\tif (argc == 3)\n+\t\treturn config_set_in_gitmodules_file_gently(argv[1], argv[2]);\n+\n+\tdie(\"submodule--helper config takes 1 or 2 arguments: name [value]\");\n+}\n+\n #define SUPPORT_SUPER_PREFIX (1<<0)\n \n struct cmd_struct {\n@@ -2155,6 +2168,7 @@ static struct cmd_struct commands[] = {\n \t{\"absorb-git-dirs\", absorb_git_dirs, SUPPORT_SUPER_PREFIX},\n \t{\"is-active\", is_active, 0},\n \t{\"check-name\", check_name, 0},\n+\t{\"config\", module_config, 0},\n };\n \n int cmd_submodule__helper(int argc, const char **argv, const char *prefix)\ndiff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh\nindex b1f3c6489b..791245f18d 100755\n--- a/t/t7411-submodule-config.sh\n+++ b/t/t7411-submodule-config.sh\n@@ -134,4 +134,31 @@ test_expect_success 'error in history in fetchrecursesubmodule lets continue' '\n \t)\n '\n \n+test_expect_success 'reading submodules config with \"submodule--helper config\"' '\n+\t(cd super &&\n+\t\techo \"../submodule\" >expect &&\n+\t\tgit submodule--helper config submodule.submodule.url >actual &&\n+\t\ttest_cmp expect actual\n+\t)\n+'\n+\n+test_expect_success 'writing submodules config with \"submodule--helper config\"' '\n+\t(cd super &&\n+\t\techo \"new_url\" >expect &&\n+\t\tgit submodule--helper config submodule.submodule.url \"new_url\" &&\n+\t\tgit submodule--helper config submodule.submodule.url >actual &&\n+\t\ttest_cmp expect actual\n+\t)\n+'\n+\n+test_expect_success 'overwriting unstaged submodules config with \"submodule--helper config\"' '\n+\ttest_when_finished \"git -C super checkout .gitmodules\" &&\n+\t(cd super &&\n+\t\techo \"newer_url\" >expect &&\n+\t\tgit submodule--helper config submodule.submodule.url \"newer_url\" &&\n+\t\tgit submodule--helper config submodule.submodule.url >actual &&\n+\t\ttest_cmp expect actual\n+\t)\n+'\n+\n test_done\n-- \n2.19.1\n\n"},{"id":"361526","messageId":"20181025161813.17252-5-ao2@ao2.it","threadId":"49678","inReplyTo":"20181025161813.17252-1-ao2@ao2.it","subject":"[PATCH v7 04/10] t7411: be nicer to future tests and really clean things up","fromName":"Antonio Ospite","fromEmail":"ao2@ao2.it","sentAt":"2018-10-25T16:18:07Z","receivedAt":"2018-10-25T16:18:34Z","isPatch":true,"sender":{"key":"ao2@ao2.it","avatar":"https://avatars.githubusercontent.com/u/1249395?v=4"},"body":"Tests 5 and 7 in t/t7411-submodule-config.sh add two commits with\ninvalid lines in .gitmodules but then only the second commit is removed.\n\nThis may affect future subsequent tests if they assume that the\n.gitmodules file has no errors.\n\nRemove both the commits as soon as they are not needed anymore.\n\nSigned-off-by: Antonio Ospite <ao2@ao2.it>\n---\n t/t7411-submodule-config.sh | 7 +++++--\n 1 file changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh\nindex f2cd1f4a2c..b1f3c6489b 100755\n--- a/t/t7411-submodule-config.sh\n+++ b/t/t7411-submodule-config.sh\n@@ -83,6 +83,8 @@ Submodule name: 'submodule' for path 'submodule'\n EOF\n \n test_expect_success 'error in history of one submodule config lets continue, stderr message contains blob ref' '\n+\tORIG=$(git -C super rev-parse HEAD) &&\n+\ttest_when_finished \"git -C super reset --hard $ORIG\" &&\n \t(cd super &&\n \t\tcp .gitmodules .gitmodules.bak &&\n \t\techo \"\tvalue = \\\"\" >>.gitmodules &&\n@@ -115,6 +117,8 @@ test_expect_success 'using different treeishs works' '\n '\n \n test_expect_success 'error in history in fetchrecursesubmodule lets continue' '\n+\tORIG=$(git -C super rev-parse HEAD) &&\n+\ttest_when_finished \"git -C super reset --hard $ORIG\" &&\n \t(cd super &&\n \t\tgit config -f .gitmodules \\\n \t\t\tsubmodule.submodule.fetchrecursesubmodules blabla &&\n@@ -126,8 +130,7 @@ test_expect_success 'error in history in fetchrecursesubmodule lets continue' '\n \t\t\tHEAD b \\\n \t\t\tHEAD submodule \\\n \t\t\t\t>actual &&\n-\t\ttest_cmp expect_error actual  &&\n-\t\tgit reset --hard HEAD^\n+\t\ttest_cmp expect_error actual\n \t)\n '\n \n-- \n2.19.1\n\n"},{"id":"361525","messageId":"20181025161813.17252-10-ao2@ao2.it","threadId":"49678","inReplyTo":"20181025161813.17252-1-ao2@ao2.it","subject":"[PATCH v7 09/10] submodule: support reading .gitmodules when it's not in the working tree","fromName":"Antonio Ospite","fromEmail":"ao2@ao2.it","sentAt":"2018-10-25T16:18:12Z","receivedAt":"2018-10-25T16:18:35Z","isPatch":true,"sender":{"key":"ao2@ao2.it","avatar":"https://avatars.githubusercontent.com/u/1249395?v=4"},"body":"When the .gitmodules file is not available in the working tree, try\nusing the content from the index and from the current branch. This\ncovers the case when the file is part of the repository but for some\nreason it is not checked out, for example because of a sparse checkout.\n\nThis makes it possible to use at least the 'git submodule' commands\nwhich *read* the gitmodules configuration file without fully populating\nthe working tree.\n\nWriting to .gitmodules will still require that the file is checked out,\nso check for that before calling config_set_in_gitmodules_file_gently.\n\nAdd a similar check also in git-submodule.sh::cmd_add() to anticipate\nthe eventual failure of the \"git submodule add\" command when .gitmodules\nis not safely writeable; this prevents the command from leaving the\nrepository in a spurious state (e.g. the submodule repository was cloned\nbut .gitmodules was not updated because\nconfig_set_in_gitmodules_file_gently failed).\n\nMoreover, since config_from_gitmodules() now accesses the global object\nstore, it is necessary to protect all code paths which call the function\nagainst concurrent access to the global object store. Currently this\nonly happens in builtin/grep.c::grep_submodules(), so call\ngrep_read_lock() before invoking code involving\nconfig_from_gitmodules().\n\nFinally, add t7418-submodule-sparse-gitmodules.sh to verify that reading\nfrom .gitmodules succeeds and that writing to it fails when the file is\nnot checked out.\n\nNOTE: there is one rare case where this new feature does not work\nproperly yet: nested submodules without .gitmodules in their working\ntree.  This has been documented with a warning and a test_expect_failure\nitem in t7814, and in this case the current behavior is not altered: no\nconfig is read.\n\nSigned-off-by: Antonio Ospite <ao2@ao2.it>\n---\n builtin/grep.c                         |  17 +++-\n builtin/submodule--helper.c            |   6 +-\n git-submodule.sh                       |   5 +\n submodule-config.c                     |  31 ++++++-\n t/t7411-submodule-config.sh            |  26 +++++-\n t/t7418-submodule-sparse-gitmodules.sh | 122 +++++++++++++++++++++++++\n t/t7814-grep-recurse-submodules.sh     |  16 ++++\n 7 files changed, 216 insertions(+), 7 deletions(-)\n create mode 100755 t/t7418-submodule-sparse-gitmodules.sh\n\ndiff --git a/builtin/grep.c b/builtin/grep.c\nindex d8508ddf79..56e4a11052 100644\n--- a/builtin/grep.c\n+++ b/builtin/grep.c\n@@ -422,11 +422,23 @@ static int grep_submodule(struct grep_opt *opt, struct repository *superproject,\n \tstruct repository submodule;\n \tint hit;\n \n-\tif (!is_submodule_active(superproject, path))\n+\t/*\n+\t * NEEDSWORK: submodules functions need to be protected because they\n+\t * access the object store via config_from_gitmodules(): the latter\n+\t * uses get_oid() which, for now, relies on the global the_repository\n+\t * object.\n+\t */\n+\tgrep_read_lock();\n+\n+\tif (!is_submodule_active(superproject, path)) {\n+\t\tgrep_read_unlock();\n \t\treturn 0;\n+\t}\n \n-\tif (repo_submodule_init(&submodule, superproject, path))\n+\tif (repo_submodule_init(&submodule, superproject, path)) {\n+\t\tgrep_read_unlock();\n \t\treturn 0;\n+\t}\n \n \trepo_read_gitmodules(&submodule);\n \n@@ -440,7 +452,6 @@ static int grep_submodule(struct grep_opt *opt, struct repository *superproject,\n \t * store is no longer global and instead is a member of the repository\n \t * object.\n \t */\n-\tgrep_read_lock();\n \tadd_to_alternates_memory(submodule.objects->objectdir);\n \tgrep_read_unlock();\n \ndiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\nindex b272a78801..05ce666142 100644\n--- a/builtin/submodule--helper.c\n+++ b/builtin/submodule--helper.c\n@@ -2155,8 +2155,12 @@ static int module_config(int argc, const char **argv, const char *prefix)\n \t\treturn print_config_from_gitmodules(the_repository, argv[1]);\n \n \t/* Equivalent to ACTION_SET in builtin/config.c */\n-\tif (argc == 3)\n+\tif (argc == 3) {\n+\t\tif (!is_writing_gitmodules_ok())\n+\t\t\tdie(_(\"please make sure that the .gitmodules file is in the working tree\"));\n+\n \t\treturn config_set_in_gitmodules_file_gently(argv[1], argv[2]);\n+\t}\n \n \tusage_with_options(git_submodule_helper_usage, module_config_options);\n }\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 0805fadf47..f5124bbf23 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -159,6 +159,11 @@ cmd_add()\n \t\tshift\n \tdone\n \n+\tif ! git submodule--helper config --check-writeable >/dev/null 2>&1\n+\tthen\n+\t\t die \"$(eval_gettext \"please make sure that the .gitmodules file is in the working tree\")\"\n+\tfi\n+\n \tif test -n \"$reference_path\"\n \tthen\n \t\tis_absolute_path \"$reference_path\" ||\ndiff --git a/submodule-config.c b/submodule-config.c\nindex 329c0b44f6..52702c62d9 100644\n--- a/submodule-config.c\n+++ b/submodule-config.c\n@@ -1,4 +1,5 @@\n #include \"cache.h\"\n+#include \"dir.h\"\n #include \"repository.h\"\n #include \"config.h\"\n #include \"submodule-config.h\"\n@@ -613,8 +614,34 @@ static void submodule_cache_check_init(struct repository *repo)\n static void config_from_gitmodules(config_fn_t fn, struct repository *repo, void *data)\n {\n \tif (repo->worktree) {\n-\t\tchar *file = repo_worktree_path(repo, GITMODULES_FILE);\n-\t\tgit_config_from_file(fn, file, data);\n+\t\tstruct git_config_source config_source = { 0 };\n+\t\tconst struct config_options opts = { 0 };\n+\t\tstruct object_id oid;\n+\t\tchar *file;\n+\n+\t\tfile = repo_worktree_path(repo, GITMODULES_FILE);\n+\t\tif (file_exists(file)) {\n+\t\t\tconfig_source.file = file;\n+\t\t} else if (repo->submodule_prefix) {\n+\t\t\t/*\n+\t\t\t * When get_oid and config_with_options, used below,\n+\t\t\t * become able to work on a specific repository, this\n+\t\t\t * warning branch can be removed.\n+\t\t\t */\n+\t\t\twarning(\"nested submodules without %s in the working tree are not supported yet\",\n+\t\t\t\tGITMODULES_FILE);\n+\t\t\tgoto out;\n+\t\t} else if (get_oid(GITMODULES_INDEX, &oid) >= 0) {\n+\t\t\tconfig_source.blob = GITMODULES_INDEX;\n+\t\t} else if (get_oid(GITMODULES_HEAD, &oid) >= 0) {\n+\t\t\tconfig_source.blob = GITMODULES_HEAD;\n+\t\t} else {\n+\t\t\tgoto out;\n+\t\t}\n+\n+\t\tconfig_with_options(fn, data, &config_source, &opts);\n+\n+out:\n \t\tfree(file);\n \t}\n }\ndiff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh\nindex 45953f9300..2cfabb18bc 100755\n--- a/t/t7411-submodule-config.sh\n+++ b/t/t7411-submodule-config.sh\n@@ -134,7 +134,7 @@ test_expect_success 'error in history in fetchrecursesubmodule lets continue' '\n \t)\n '\n \n-test_expect_success 'reading submodules config with \"submodule--helper config\"' '\n+test_expect_success 'reading submodules config from the working tree with \"submodule--helper config\"' '\n \t(cd super &&\n \t\techo \"../submodule\" >expect &&\n \t\tgit submodule--helper config submodule.submodule.url >actual &&\n@@ -192,4 +192,28 @@ test_expect_success 'non-writeable .gitmodules when it is in the current branch\n \t)\n '\n \n+test_expect_success 'reading submodules config from the index when .gitmodules is not in the working tree' '\n+\tORIG=$(git -C super rev-parse HEAD) &&\n+\ttest_when_finished \"git -C super reset --hard $ORIG\" &&\n+\t(cd super &&\n+\t\tgit submodule--helper config submodule.submodule.url \"staged_url\" &&\n+\t\tgit add .gitmodules &&\n+\t\trm -f .gitmodules &&\n+\t\techo \"staged_url\" >expect &&\n+\t\tgit submodule--helper config submodule.submodule.url >actual &&\n+\t\ttest_cmp expect actual\n+\t)\n+'\n+\n+test_expect_success 'reading submodules config from the current branch when .gitmodules is not in the index' '\n+\tORIG=$(git -C super rev-parse HEAD) &&\n+\ttest_when_finished \"git -C super reset --hard $ORIG\" &&\n+\t(cd super &&\n+\t\tgit rm .gitmodules &&\n+\t\techo \"../submodule\" >expect &&\n+\t\tgit submodule--helper config submodule.submodule.url >actual &&\n+\t\ttest_cmp expect actual\n+\t)\n+'\n+\n test_done\ndiff --git a/t/t7418-submodule-sparse-gitmodules.sh b/t/t7418-submodule-sparse-gitmodules.sh\nnew file mode 100755\nindex 0000000000..21a86b89c6\n--- /dev/null\n+++ b/t/t7418-submodule-sparse-gitmodules.sh\n@@ -0,0 +1,122 @@\n+#!/bin/sh\n+#\n+# Copyright (C) 2018  Antonio Ospite <ao2@ao2.it>\n+#\n+\n+test_description='Test reading/writing .gitmodules when not in the working tree\n+\n+This test verifies that, when .gitmodules is in the current branch but is not\n+in the working tree reading from it still works but writing to it does not.\n+\n+The test setup uses a sparse checkout, however the same scenario can be set up\n+also by committing .gitmodules and then just removing it from the filesystem.\n+'\n+\n+. ./test-lib.sh\n+\n+test_expect_success 'sparse checkout setup which hides .gitmodules' '\n+\tgit init upstream &&\n+\tgit init submodule &&\n+\t(cd submodule &&\n+\t\techo file >file &&\n+\t\tgit add file &&\n+\t\ttest_tick &&\n+\t\tgit commit -m \"Add file\"\n+\t) &&\n+\t(cd upstream &&\n+\t\tgit submodule add ../submodule &&\n+\t\ttest_tick &&\n+\t\tgit commit -m \"Add submodule\"\n+\t) &&\n+\tgit clone upstream super &&\n+\t(cd super &&\n+\t\tcat >.git/info/sparse-checkout <<-\\EOF &&\n+\t\t/*\n+\t\t!/.gitmodules\n+\t\tEOF\n+\t\tgit config core.sparsecheckout true &&\n+\t\tgit read-tree -m -u HEAD &&\n+\t\ttest_path_is_missing .gitmodules\n+\t)\n+'\n+\n+test_expect_success 'reading gitmodules config file when it is not checked out' '\n+\techo \"../submodule\" >expect &&\n+\tgit -C super submodule--helper config submodule.submodule.url >actual &&\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'not writing gitmodules config file when it is not checked out' '\n+\ttest_must_fail git -C super submodule--helper config submodule.submodule.url newurl &&\n+\ttest_path_is_missing super/.gitmodules\n+'\n+\n+test_expect_success 'initialising submodule when the gitmodules config is not checked out' '\n+\ttest_must_fail git -C super config submodule.submodule.url &&\n+\tgit -C super submodule init &&\n+\tgit -C super config submodule.submodule.url >actual &&\n+\techo \"$PWD/submodule\" >expect &&\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'updating submodule when the gitmodules config is not checked out' '\n+\ttest_path_is_missing super/submodule/file &&\n+\tgit -C super submodule update &&\n+\ttest_cmp submodule/file super/submodule/file\n+'\n+\n+ORIG_SUBMODULE=$(git -C submodule rev-parse HEAD)\n+ORIG_UPSTREAM=$(git -C upstream rev-parse HEAD)\n+ORIG_SUPER=$(git -C super rev-parse HEAD)\n+\n+test_expect_success 're-updating submodule when the gitmodules config is not checked out' '\n+\ttest_when_finished \"git -C submodule reset --hard $ORIG_SUBMODULE;\n+\t\t\t    git -C upstream reset --hard $ORIG_UPSTREAM;\n+\t\t\t    git -C super reset --hard $ORIG_SUPER;\n+\t\t\t    git -C upstream submodule update --remote;\n+\t\t\t    git -C super pull;\n+\t\t\t    git -C super submodule update --remote\" &&\n+\t(cd submodule &&\n+\t\techo file2 >file2 &&\n+\t\tgit add file2 &&\n+\t\ttest_tick &&\n+\t\tgit commit -m \"Add file2 to submodule\"\n+\t) &&\n+\t(cd upstream &&\n+\t\tgit submodule update --remote &&\n+\t\tgit add submodule &&\n+\t\ttest_tick &&\n+\t\tgit commit -m \"Update submodule\"\n+\t) &&\n+\tgit -C super pull &&\n+\t# The --for-status options reads the gitmodules config\n+\tgit -C super submodule summary --for-status >actual &&\n+\trev1=$(git -C submodule rev-parse --short HEAD) &&\n+\trev2=$(git -C submodule rev-parse --short HEAD^) &&\n+\tcat >expect <<-EOF &&\n+\t* submodule ${rev1}...${rev2} (1):\n+\t  < Add file2 to submodule\n+\n+\tEOF\n+\ttest_cmp expect actual &&\n+\t# Test that the update actually succeeds\n+\ttest_path_is_missing super/submodule/file2 &&\n+\tgit -C super submodule update &&\n+\ttest_cmp submodule/file2 super/submodule/file2 &&\n+\tgit -C super status --short >output &&\n+\ttest_must_be_empty output\n+'\n+\n+test_expect_success 'not adding submodules when the gitmodules config is not checked out' '\n+\tgit clone submodule new_submodule &&\n+\ttest_must_fail git -C super submodule add ../new_submodule &&\n+\ttest_path_is_missing .gitmodules\n+'\n+\n+# This test checks that the previous \"git submodule add\" did not leave the\n+# repository in a spurious state when it failed.\n+test_expect_success 'init submodule still works even after the previous add failed' '\n+\tgit -C super submodule init\n+'\n+\n+test_done\ndiff --git a/t/t7814-grep-recurse-submodules.sh b/t/t7814-grep-recurse-submodules.sh\nindex 7184113b9b..fa475d52fa 100755\n--- a/t/t7814-grep-recurse-submodules.sh\n+++ b/t/t7814-grep-recurse-submodules.sh\n@@ -380,4 +380,20 @@ test_expect_success 'grep --recurse-submodules should pass the pattern type alon\n \tfi\n '\n \n+# Recursing down into nested submodules which do not have .gitmodules in their\n+# working tree does not work yet. This is because config_from_gitmodules()\n+# uses get_oid() and the latter is still not able to get objects from an\n+# arbitrary repository (the nested submodule, in this case).\n+test_expect_failure 'grep --recurse-submodules with submodules without .gitmodules in the working tree' '\n+\ttest_when_finished \"git -C submodule checkout .gitmodules\" &&\n+\trm submodule/.gitmodules &&\n+\tgit grep --recurse-submodules -e \"(.|.)[\\d]\" >actual &&\n+\tcat >expect <<-\\EOF &&\n+\ta:(1|2)d(3|4)\n+\tsubmodule/a:(1|2)d(3|4)\n+\tsubmodule/sub/a:(1|2)d(3|4)\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n test_done\n-- \n2.19.1\n\n"},{"id":"361527","messageId":"20181025161813.17252-8-ao2@ao2.it","threadId":"49678","inReplyTo":"20181025161813.17252-1-ao2@ao2.it","subject":"[PATCH v7 07/10] t7506: clean up .gitmodules properly before setting up new scenario","fromName":"Antonio Ospite","fromEmail":"ao2@ao2.it","sentAt":"2018-10-25T16:18:10Z","receivedAt":"2018-10-25T16:18:36Z","isPatch":true,"sender":{"key":"ao2@ao2.it","avatar":"https://avatars.githubusercontent.com/u/1249395?v=4"},"body":"In t/t7506-status-submodule.sh at some point a new scenario is set up to\ntest different things, in particular new submodules are added which are\nmeant to completely replace the previous ones.\n\nHowever before calling the \"git submodule add\" commands for the new\nlayout, the .gitmodules file is removed only from the working tree still\nleaving the previous content in current branch.\n\nThis can break if, in the future, \"git submodule add\" starts\ndifferentiating between the following two cases:\n\n  - .gitmodules is not in the working tree but it is in the current\n    branch (it may not be safe to add new submodules in this case);\n\n  - .gitmodules is neither in the working tree nor anywhere in the\n    current branch (it is safe to add new submodules).\n\nSince the test intends to get rid of .gitmodules anyways, let's\ncompletely remove it from the current branch, to actually start afresh\nin the new scenario.\n\nThis is more future-proof and does not break current tests.\n\nSigned-off-by: Antonio Ospite <ao2@ao2.it>\n---\n t/t7506-status-submodule.sh | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh\nindex 943708fb04..08629a6e70 100755\n--- a/t/t7506-status-submodule.sh\n+++ b/t/t7506-status-submodule.sh\n@@ -325,7 +325,8 @@ test_expect_success 'setup superproject with untracked file in nested submodule'\n \t(\n \t\tcd super &&\n \t\tgit clean -dfx &&\n-\t\trm .gitmodules &&\n+\t\tgit rm .gitmodules &&\n+\t\tgit commit -m \"remove .gitmodules\" &&\n \t\tgit submodule add -f ./sub1 &&\n \t\tgit submodule add -f ./sub2 &&\n \t\tgit submodule add -f ./sub1 sub3 &&\n-- \n2.19.1\n\n"},{"id":"361528","messageId":"20181025161813.17252-1-ao2@ao2.it","threadId":"49678","inReplyTo":null,"subject":"[PATCH v7 00/10] Make submodules work if .gitmodules is not checked out","fromName":"Antonio Ospite","fromEmail":"ao2@ao2.it","sentAt":"2018-10-25T16:18:03Z","receivedAt":"2018-10-25T16:18:36Z","isPatch":true,"sender":{"key":"ao2@ao2.it","avatar":"https://avatars.githubusercontent.com/u/1249395?v=4"},"body":"Hi,\n\nthis series teaches git to try and read the .gitmodules file from the\nindex (:.gitmodules) or from the current branch (HEAD:.gitmodules) when\nthe file is not readily available in the working tree.\n\nThis can be used, together with sparse checkouts, to enable submodule\nusage with programs like vcsh[1] which manage multiple repositories with\ntheir working trees sharing the same path.\n\n[1] https://github.com/RichiH/vcsh\n\nIn the previous series there were some comments about not using the enum\nin patch 8, but I decided to leave the code as it was as I still think\nthat it make sense to use an enum there, and have the default value\nunnamed; during the discussion I pointed out that other code in git do\nthe same.\n\nIn this series I am addressing the comments by Stefan Beller about the\ntests in patch 9.\n\nIf the new tests look OK, I'd say we try moving the series to \"next\" and\nsee what happens?\n\nI am available to address any further concerns in follow-up patches.\n\nv6 of the series is here:\nhttps://public-inbox.org/git/20181005130601.15879-1-ao2@ao2.it/\n\nv5 of the series is here:\nhttps://public-inbox.org/git/20180917140940.3839-1-ao2@ao2.it/\n\nv4 of the series is here:\nhttps://public-inbox.org/git/20180824132951.8000-1-ao2@ao2.it/\n\nv3 of the series is here:\nhttps://public-inbox.org/git/20180814110525.17801-1-ao2@ao2.it/\n\nv2 of the series is here:\nhttps://public-inbox.org/git/20180802134634.10300-1-ao2@ao2.it/\n\nv1 of the series, with some background info, is here:\nhttps://public-inbox.org/git/20180514105823.8378-1-ao2@ao2.it/\n\nChanges since v6:\n\n  * Renamed t7416-submodule-sparse-gitmodules.sh to\n    t7418-submodule-sparse-gitmodules.sh because t7416 was already\n    taken.  This has been already taken care of by Junio in \"pu\".\n\n  * Improved tests in t7418: now, instead of just testing the return\n    value of \"git submodule ...\" commands when .gitmodules is not in the\n    working tree, the actual use case is checked in each test, with pre-\n    and post-conditions.\n\nThank you,\n   Antonio\n\nAntonio Ospite (10):\n  submodule: add a print_config_from_gitmodules() helper\n  submodule: factor out a config_set_in_gitmodules_file_gently function\n  t7411: merge tests 5 and 6\n  t7411: be nicer to future tests and really clean things up\n  submodule--helper: add a new 'config' subcommand\n  submodule: use the 'submodule--helper config' command\n  t7506: clean up .gitmodules properly before setting up new scenario\n  submodule: add a helper to check if it is safe to write to .gitmodules\n  submodule: support reading .gitmodules when it's not in the working\n    tree\n  t/helper: add test-submodule-nested-repo-config\n\n Makefile                                     |   1 +\n builtin/grep.c                               |  17 ++-\n builtin/submodule--helper.c                  |  40 ++++++\n cache.h                                      |   2 +\n git-submodule.sh                             |  13 +-\n submodule-config.c                           |  68 ++++++++-\n submodule-config.h                           |   2 +\n submodule.c                                  |  28 +++-\n submodule.h                                  |   1 +\n t/helper/test-submodule-nested-repo-config.c |  30 ++++\n t/helper/test-tool.c                         |   1 +\n t/helper/test-tool.h                         |   1 +\n t/t7411-submodule-config.sh                  | 141 +++++++++++++++++--\n t/t7418-submodule-sparse-gitmodules.sh       | 122 ++++++++++++++++\n t/t7506-status-submodule.sh                  |   3 +-\n t/t7814-grep-recurse-submodules.sh           |  16 +++\n 16 files changed, 454 insertions(+), 32 deletions(-)\n create mode 100644 t/helper/test-submodule-nested-repo-config.c\n create mode 100755 t/t7418-submodule-sparse-gitmodules.sh\n\n-- \nAntonio Ospite\nhttps://ao2.it\nhttps://twitter.com/ao2it\n\nA: Because it messes up the order in which people normally read text.\n   See http://en.wikipedia.org/wiki/Posting_style\nQ: Why is top-posting such a bad thing?\n"},{"id":"361529","messageId":"20181025161813.17252-7-ao2@ao2.it","threadId":"49678","inReplyTo":"20181025161813.17252-1-ao2@ao2.it","subject":"[PATCH v7 06/10] submodule: use the 'submodule--helper config' command","fromName":"Antonio Ospite","fromEmail":"ao2@ao2.it","sentAt":"2018-10-25T16:18:09Z","receivedAt":"2018-10-25T16:18:38Z","isPatch":true,"sender":{"key":"ao2@ao2.it","avatar":"https://avatars.githubusercontent.com/u/1249395?v=4"},"body":"Use the 'submodule--helper config' command in git-submodules.sh to avoid\nreferring explicitly to .gitmodules by the hardcoded file path.\n\nThis makes it possible to access the submodules configuration in a more\ncontrolled way.\n\nSigned-off-by: Antonio Ospite <ao2@ao2.it>\n---\n git-submodule.sh | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 1b568e29b9..0805fadf47 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -72,7 +72,7 @@ get_submodule_config () {\n \tvalue=$(git config submodule.\"$name\".\"$option\")\n \tif test -z \"$value\"\n \tthen\n-\t\tvalue=$(git config -f .gitmodules submodule.\"$name\".\"$option\")\n+\t\tvalue=$(git submodule--helper config submodule.\"$name\".\"$option\")\n \tfi\n \tprintf '%s' \"${value:-$default}\"\n }\n@@ -283,11 +283,11 @@ or you are unsure what this means choose another name with the '--name' option.\"\n \tgit add --no-warn-embedded-repo $force \"$sm_path\" ||\n \tdie \"$(eval_gettext \"Failed to add submodule '\\$sm_path'\")\"\n \n-\tgit config -f .gitmodules submodule.\"$sm_name\".path \"$sm_path\" &&\n-\tgit config -f .gitmodules submodule.\"$sm_name\".url \"$repo\" &&\n+\tgit submodule--helper config submodule.\"$sm_name\".path \"$sm_path\" &&\n+\tgit submodule--helper config submodule.\"$sm_name\".url \"$repo\" &&\n \tif test -n \"$branch\"\n \tthen\n-\t\tgit config -f .gitmodules submodule.\"$sm_name\".branch \"$branch\"\n+\t\tgit submodule--helper config submodule.\"$sm_name\".branch \"$branch\"\n \tfi &&\n \tgit add --force .gitmodules ||\n \tdie \"$(eval_gettext \"Failed to register submodule '\\$sm_path'\")\"\n-- \n2.19.1\n\n"},{"id":"361530","messageId":"20181025161813.17252-9-ao2@ao2.it","threadId":"49678","inReplyTo":"20181025161813.17252-1-ao2@ao2.it","subject":"[PATCH v7 08/10] submodule: add a helper to check if it is safe to write to .gitmodules","fromName":"Antonio Ospite","fromEmail":"ao2@ao2.it","sentAt":"2018-10-25T16:18:11Z","receivedAt":"2018-10-25T16:18:39Z","isPatch":true,"sender":{"key":"ao2@ao2.it","avatar":"https://avatars.githubusercontent.com/u/1249395?v=4"},"body":"Introduce a helper function named is_writing_gitmodules_ok() to verify\nthat the .gitmodules file is safe to write.\n\nThe function name follows the scheme of is_staging_gitmodules_ok().\n\nThe two symbolic constants GITMODULES_INDEX and GITMODULES_HEAD are used\nto get help from the C preprocessor in preventing typos, especially for\nfuture users.\n\nThis is in preparation for a future change which teaches git how to read\n.gitmodules from the index or from the current branch if the file is not\navailable in the working tree.\n\nThe rationale behind the check is that writing to .gitmodules requires\nthe file to be present in the working tree, unless a brand new\n.gitmodules is being created (in which case the .gitmodules file would\nnot exist at all: neither in the working tree nor in the index or in the\ncurrent branch).\n\nExpose the functionality also via a \"submodule-helper config\n--check-writeable\" command, as git scripts may want to perform the check\nbefore modifying submodules configuration.\n\nSigned-off-by: Antonio Ospite <ao2@ao2.it>\n---\n builtin/submodule--helper.c | 24 +++++++++++++++++++++++-\n cache.h                     |  2 ++\n submodule.c                 | 18 ++++++++++++++++++\n submodule.h                 |  1 +\n t/t7411-submodule-config.sh | 31 +++++++++++++++++++++++++++++++\n 5 files changed, 75 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\nindex 9af6626e32..b272a78801 100644\n--- a/builtin/submodule--helper.c\n+++ b/builtin/submodule--helper.c\n@@ -2128,6 +2128,28 @@ static int check_name(int argc, const char **argv, const char *prefix)\n \n static int module_config(int argc, const char **argv, const char *prefix)\n {\n+\tenum {\n+\t\tCHECK_WRITEABLE = 1\n+\t} command = 0;\n+\n+\tstruct option module_config_options[] = {\n+\t\tOPT_CMDMODE(0, \"check-writeable\", &command,\n+\t\t\t    N_(\"check if it is safe to write to the .gitmodules file\"),\n+\t\t\t    CHECK_WRITEABLE),\n+\t\tOPT_END()\n+\t};\n+\tconst char *const git_submodule_helper_usage[] = {\n+\t\tN_(\"git submodule--helper config name [value]\"),\n+\t\tN_(\"git submodule--helper config --check-writeable\"),\n+\t\tNULL\n+\t};\n+\n+\targc = parse_options(argc, argv, prefix, module_config_options,\n+\t\t\t     git_submodule_helper_usage, PARSE_OPT_KEEP_ARGV0);\n+\n+\tif (argc == 1 && command == CHECK_WRITEABLE)\n+\t\treturn is_writing_gitmodules_ok() ? 0 : -1;\n+\n \t/* Equivalent to ACTION_GET in builtin/config.c */\n \tif (argc == 2)\n \t\treturn print_config_from_gitmodules(the_repository, argv[1]);\n@@ -2136,7 +2158,7 @@ static int module_config(int argc, const char **argv, const char *prefix)\n \tif (argc == 3)\n \t\treturn config_set_in_gitmodules_file_gently(argv[1], argv[2]);\n \n-\tdie(\"submodule--helper config takes 1 or 2 arguments: name [value]\");\n+\tusage_with_options(git_submodule_helper_usage, module_config_options);\n }\n \n #define SUPPORT_SUPER_PREFIX (1<<0)\ndiff --git a/cache.h b/cache.h\nindex 59c8a93046..4c1f827c54 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -486,6 +486,8 @@ static inline enum object_type object_type(unsigned int mode)\n #define INFOATTRIBUTES_FILE \"info/attributes\"\n #define ATTRIBUTE_MACRO_PREFIX \"[attr]\"\n #define GITMODULES_FILE \".gitmodules\"\n+#define GITMODULES_INDEX \":.gitmodules\"\n+#define GITMODULES_HEAD \"HEAD:.gitmodules\"\n #define GIT_NOTES_REF_ENVIRONMENT \"GIT_NOTES_REF\"\n #define GIT_NOTES_DEFAULT_REF \"refs/notes/commits\"\n #define GIT_NOTES_DISPLAY_REF_ENVIRONMENT \"GIT_NOTES_DISPLAY_REF\"\ndiff --git a/submodule.c b/submodule.c\nindex 24a49eae61..9516685478 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -51,6 +51,24 @@ int is_gitmodules_unmerged(const struct index_state *istate)\n \treturn 0;\n }\n \n+/*\n+ * Check if the .gitmodules file is safe to write.\n+ *\n+ * Writing to the .gitmodules file requires that the file exists in the\n+ * working tree or, if it doesn't, that a brand new .gitmodules file is going\n+ * to be created (i.e. it's neither in the index nor in the current branch).\n+ *\n+ * It is not safe to write to .gitmodules if it's not in the working tree but\n+ * it is in the index or in the current branch, because writing new values\n+ * (and staging them) would blindly overwrite ALL the old content.\n+ */\n+int is_writing_gitmodules_ok(void)\n+{\n+\tstruct object_id oid;\n+\treturn file_exists(GITMODULES_FILE) ||\n+\t\t(get_oid(GITMODULES_INDEX, &oid) < 0 && get_oid(GITMODULES_HEAD, &oid) < 0);\n+}\n+\n /*\n  * Check if the .gitmodules file has unstaged modifications.  This must be\n  * checked before allowing modifications to the .gitmodules file with the\ndiff --git a/submodule.h b/submodule.h\nindex 4826601ff2..ea6e115f16 100644\n--- a/submodule.h\n+++ b/submodule.h\n@@ -40,6 +40,7 @@ struct submodule_update_strategy {\n #define SUBMODULE_UPDATE_STRATEGY_INIT {SM_UPDATE_UNSPECIFIED, NULL}\n \n int is_gitmodules_unmerged(const struct index_state *istate);\n+int is_writing_gitmodules_ok(void);\n int is_staging_gitmodules_ok(struct index_state *istate);\n int update_path_in_gitmodules(const char *oldpath, const char *newpath);\n int remove_path_from_gitmodules(const char *path);\ndiff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh\nindex 791245f18d..45953f9300 100755\n--- a/t/t7411-submodule-config.sh\n+++ b/t/t7411-submodule-config.sh\n@@ -161,4 +161,35 @@ test_expect_success 'overwriting unstaged submodules config with \"submodule--hel\n \t)\n '\n \n+test_expect_success 'writeable .gitmodules when it is in the working tree' '\n+\tgit -C super submodule--helper config --check-writeable\n+'\n+\n+test_expect_success 'writeable .gitmodules when it is nowhere in the repository' '\n+\tORIG=$(git -C super rev-parse HEAD) &&\n+\ttest_when_finished \"git -C super reset --hard $ORIG\" &&\n+\t(cd super &&\n+\t\tgit rm .gitmodules &&\n+\t\tgit commit -m \"remove .gitmodules from the current branch\" &&\n+\t\tgit submodule--helper config --check-writeable\n+\t)\n+'\n+\n+test_expect_success 'non-writeable .gitmodules when it is in the index but not in the working tree' '\n+\ttest_when_finished \"git -C super checkout .gitmodules\" &&\n+\t(cd super &&\n+\t\trm -f .gitmodules &&\n+\t\ttest_must_fail git submodule--helper config --check-writeable\n+\t)\n+'\n+\n+test_expect_success 'non-writeable .gitmodules when it is in the current branch but not in the index' '\n+\tORIG=$(git -C super rev-parse HEAD) &&\n+\ttest_when_finished \"git -C super reset --hard $ORIG\" &&\n+\t(cd super &&\n+\t\tgit rm .gitmodules &&\n+\t\ttest_must_fail git submodule--helper config --check-writeable\n+\t)\n+'\n+\n test_done\n-- \n2.19.1\n\n"},{"id":"361531","messageId":"20181025161813.17252-11-ao2@ao2.it","threadId":"49678","inReplyTo":"20181025161813.17252-1-ao2@ao2.it","subject":"[PATCH v7 10/10] t/helper: add test-submodule-nested-repo-config","fromName":"Antonio Ospite","fromEmail":"ao2@ao2.it","sentAt":"2018-10-25T16:18:13Z","receivedAt":"2018-10-25T16:18:43Z","isPatch":true,"sender":{"key":"ao2@ao2.it","avatar":"https://avatars.githubusercontent.com/u/1249395?v=4"},"body":"Add a test tool to exercise config_from_gitmodules(), in particular for\nthe case of nested submodules.\n\nAdd also a test to document that reading the submoudles config of nested\nsubmodules does not work yet when the .gitmodules file is not in the\nworking tree but it still in the index.\n\nThis is because the git API does not always make it possible access the\nobject store  of an arbitrary repository (see get_oid() usage in\nconfig_from_gitmodules()).\n\nWhen this git limitation gets fixed the aforementioned use case will be\nsupported too.\n\nSigned-off-by: Antonio Ospite <ao2@ao2.it>\n---\n Makefile                                     |  1 +\n t/helper/test-submodule-nested-repo-config.c | 30 +++++++++++++++++\n t/helper/test-tool.c                         |  1 +\n t/helper/test-tool.h                         |  1 +\n t/t7411-submodule-config.sh                  | 34 ++++++++++++++++++++\n 5 files changed, 67 insertions(+)\n create mode 100644 t/helper/test-submodule-nested-repo-config.c\n\ndiff --git a/Makefile b/Makefile\nindex d18ab0fe78..d8f4dfdb3e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -741,6 +741,7 @@ TEST_BUILTINS_OBJS += test-sigchain.o\n TEST_BUILTINS_OBJS += test-strcmp-offset.o\n TEST_BUILTINS_OBJS += test-string-list.o\n TEST_BUILTINS_OBJS += test-submodule-config.o\n+TEST_BUILTINS_OBJS += test-submodule-nested-repo-config.o\n TEST_BUILTINS_OBJS += test-subprocess.o\n TEST_BUILTINS_OBJS += test-urlmatch-normalization.o\n TEST_BUILTINS_OBJS += test-wildmatch.o\ndiff --git a/t/helper/test-submodule-nested-repo-config.c b/t/helper/test-submodule-nested-repo-config.c\nnew file mode 100644\nindex 0000000000..a31e2a9bea\n--- /dev/null\n+++ b/t/helper/test-submodule-nested-repo-config.c\n@@ -0,0 +1,30 @@\n+#include \"test-tool.h\"\n+#include \"submodule-config.h\"\n+\n+static void die_usage(int argc, const char **argv, const char *msg)\n+{\n+\tfprintf(stderr, \"%s\\n\", msg);\n+\tfprintf(stderr, \"Usage: %s <submodulepath> <config name>\\n\", argv[0]);\n+\texit(1);\n+}\n+\n+int cmd__submodule_nested_repo_config(int argc, const char **argv)\n+{\n+\tstruct repository submodule;\n+\n+\tif (argc < 3)\n+\t\tdie_usage(argc, argv, \"Wrong number of arguments.\");\n+\n+\tsetup_git_directory();\n+\n+\tif (repo_submodule_init(&submodule, the_repository, argv[1])) {\n+\t\tdie_usage(argc, argv, \"Submodule not found.\");\n+\t}\n+\n+\t/* Read the config of _child_ submodules. */\n+\tprint_config_from_gitmodules(&submodule, argv[2]);\n+\n+\tsubmodule_free(the_repository);\n+\n+\treturn 0;\n+}\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 6b5836dc1b..ca5c5ede6c 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -46,6 +46,7 @@ static struct test_cmd cmds[] = {\n \t{ \"strcmp-offset\", cmd__strcmp_offset },\n \t{ \"string-list\", cmd__string_list },\n \t{ \"submodule-config\", cmd__submodule_config },\n+\t{ \"submodule-nested-repo-config\", cmd__submodule_nested_repo_config },\n \t{ \"subprocess\", cmd__subprocess },\n \t{ \"urlmatch-normalization\", cmd__urlmatch_normalization },\n \t{ \"wildmatch\", cmd__wildmatch },\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex e4890566da..500e3684e1 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -42,6 +42,7 @@ int cmd__sigchain(int argc, const char **argv);\n int cmd__strcmp_offset(int argc, const char **argv);\n int cmd__string_list(int argc, const char **argv);\n int cmd__submodule_config(int argc, const char **argv);\n+int cmd__submodule_nested_repo_config(int argc, const char **argv);\n int cmd__subprocess(int argc, const char **argv);\n int cmd__urlmatch_normalization(int argc, const char **argv);\n int cmd__wildmatch(int argc, const char **argv);\ndiff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh\nindex 2cfabb18bc..89690b7adb 100755\n--- a/t/t7411-submodule-config.sh\n+++ b/t/t7411-submodule-config.sh\n@@ -216,4 +216,38 @@ test_expect_success 'reading submodules config from the current branch when .git\n \t)\n '\n \n+test_expect_success 'reading nested submodules config' '\n+\t(cd super &&\n+\t\tgit init submodule/nested_submodule &&\n+\t\techo \"a\" >submodule/nested_submodule/a &&\n+\t\tgit -C submodule/nested_submodule add a &&\n+\t\tgit -C submodule/nested_submodule commit -m \"add a\" &&\n+\t\tgit -C submodule submodule add ./nested_submodule &&\n+\t\tgit -C submodule add nested_submodule &&\n+\t\tgit -C submodule commit -m \"added nested_submodule\" &&\n+\t\tgit add submodule &&\n+\t\tgit commit -m \"updated submodule\" &&\n+\t\techo \"./nested_submodule\" >expect &&\n+\t\ttest-tool submodule-nested-repo-config \\\n+\t\t\tsubmodule submodule.nested_submodule.url >actual &&\n+\t\ttest_cmp expect actual\n+\t)\n+'\n+\n+# When this test eventually passes, before turning it into\n+# test_expect_success, remember to replace the test_i18ngrep below with\n+# a \"test_must_be_empty warning\" to be sure that the warning is actually\n+# removed from the code.\n+test_expect_failure 'reading nested submodules config when .gitmodules is not in the working tree' '\n+\ttest_when_finished \"git -C super/submodule checkout .gitmodules\" &&\n+\t(cd super &&\n+\t\techo \"./nested_submodule\" >expect &&\n+\t\trm submodule/.gitmodules &&\n+\t\ttest-tool submodule-nested-repo-config \\\n+\t\t\tsubmodule submodule.nested_submodule.url >actual 2>warning &&\n+\t\ttest_i18ngrep \"nested submodules without %s in the working tree are not supported yet\" warning &&\n+\t\ttest_cmp expect actual\n+\t)\n+'\n+\n test_done\n-- \n2.19.1\n\n"},{"id":"361532","messageId":"20181025161813.17252-3-ao2@ao2.it","threadId":"49678","inReplyTo":"20181025161813.17252-1-ao2@ao2.it","subject":"[PATCH v7 02/10] submodule: factor out a config_set_in_gitmodules_file_gently function","fromName":"Antonio Ospite","fromEmail":"ao2@ao2.it","sentAt":"2018-10-25T16:18:05Z","receivedAt":"2018-10-25T16:18:45Z","isPatch":true,"sender":{"key":"ao2@ao2.it","avatar":"https://avatars.githubusercontent.com/u/1249395?v=4"},"body":"Introduce a new config_set_in_gitmodules_file_gently() function to write\nconfig values to the .gitmodules file.\n\nThis is in preparation for a future change which will use the function\nto write to the .gitmodules file in a more controlled way instead of\nusing \"git config -f .gitmodules\".\n\nThe purpose of the change is mainly to centralize the code that writes\nto the .gitmodules file to avoid some duplication.\n\nThe naming follows git_config_set_in_file_gently() but the git_ prefix\nis removed to communicate that this is not a generic git-config API.\n\nSigned-off-by: Antonio Ospite <ao2@ao2.it>\n---\n submodule-config.c | 12 ++++++++++++\n submodule-config.h |  1 +\n submodule.c        | 10 +++-------\n 3 files changed, 16 insertions(+), 7 deletions(-)\n\ndiff --git a/submodule-config.c b/submodule-config.c\nindex e36d4e2271..329c0b44f6 100644\n--- a/submodule-config.c\n+++ b/submodule-config.c\n@@ -717,6 +717,18 @@ int print_config_from_gitmodules(struct repository *repo, const char *key)\n \treturn 0;\n }\n \n+int config_set_in_gitmodules_file_gently(const char *key, const char *value)\n+{\n+\tint ret;\n+\n+\tret = git_config_set_in_file_gently(GITMODULES_FILE, key, value);\n+\tif (ret < 0)\n+\t\t/* Maybe the user already did that, don't error out here */\n+\t\twarning(_(\"Could not update .gitmodules entry %s\"), key);\n+\n+\treturn ret;\n+}\n+\n struct fetch_config {\n \tint *max_children;\n \tint *recurse_submodules;\ndiff --git a/submodule-config.h b/submodule-config.h\nindex 031747ccf8..4dc9b0771c 100644\n--- a/submodule-config.h\n+++ b/submodule-config.h\n@@ -49,6 +49,7 @@ const struct submodule *submodule_from_path(struct repository *r,\n \t\t\t\t\t    const char *path);\n void submodule_free(struct repository *r);\n int print_config_from_gitmodules(struct repository *repo, const char *key);\n+int config_set_in_gitmodules_file_gently(const char *key, const char *value);\n \n /*\n  * Returns 0 if the name is syntactically acceptable as a submodule \"name\"\ndiff --git a/submodule.c b/submodule.c\nindex d9d3046689..24a49eae61 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -89,6 +89,7 @@ int update_path_in_gitmodules(const char *oldpath, const char *newpath)\n {\n \tstruct strbuf entry = STRBUF_INIT;\n \tconst struct submodule *submodule;\n+\tint ret;\n \n \tif (!file_exists(GITMODULES_FILE)) /* Do nothing without .gitmodules */\n \t\treturn -1;\n@@ -104,14 +105,9 @@ int update_path_in_gitmodules(const char *oldpath, const char *newpath)\n \tstrbuf_addstr(&entry, \"submodule.\");\n \tstrbuf_addstr(&entry, submodule->name);\n \tstrbuf_addstr(&entry, \".path\");\n-\tif (git_config_set_in_file_gently(GITMODULES_FILE, entry.buf, newpath) < 0) {\n-\t\t/* Maybe the user already did that, don't error out here */\n-\t\twarning(_(\"Could not update .gitmodules entry %s\"), entry.buf);\n-\t\tstrbuf_release(&entry);\n-\t\treturn -1;\n-\t}\n+\tret = config_set_in_gitmodules_file_gently(entry.buf, newpath);\n \tstrbuf_release(&entry);\n-\treturn 0;\n+\treturn ret;\n }\n \n /*\n-- \n2.19.1\n\n"},{"id":"361533","messageId":"20181025161813.17252-4-ao2@ao2.it","threadId":"49678","inReplyTo":"20181025161813.17252-1-ao2@ao2.it","subject":"[PATCH v7 03/10] t7411: merge tests 5 and 6","fromName":"Antonio Ospite","fromEmail":"ao2@ao2.it","sentAt":"2018-10-25T16:18:06Z","receivedAt":"2018-10-25T16:18:47Z","isPatch":true,"sender":{"key":"ao2@ao2.it","avatar":"https://avatars.githubusercontent.com/u/1249395?v=4"},"body":"Tests 5 and 6 check for the effects of the same commit, merge the two\ntests to make it more straightforward to clean things up after the test\nhas finished.\n\nThe cleanup will be added in a future commit.\n\nSigned-off-by: Antonio Ospite <ao2@ao2.it>\n---\n t/t7411-submodule-config.sh | 18 +++++-------------\n 1 file changed, 5 insertions(+), 13 deletions(-)\n\ndiff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh\nindex 0bde5850ac..f2cd1f4a2c 100755\n--- a/t/t7411-submodule-config.sh\n+++ b/t/t7411-submodule-config.sh\n@@ -82,29 +82,21 @@ Submodule name: 'a' for path 'b'\n Submodule name: 'submodule' for path 'submodule'\n EOF\n \n-test_expect_success 'error in one submodule config lets continue' '\n+test_expect_success 'error in history of one submodule config lets continue, stderr message contains blob ref' '\n \t(cd super &&\n \t\tcp .gitmodules .gitmodules.bak &&\n \t\techo \"\tvalue = \\\"\" >>.gitmodules &&\n \t\tgit add .gitmodules &&\n \t\tmv .gitmodules.bak .gitmodules &&\n \t\tgit commit -m \"add error\" &&\n-\t\ttest-tool submodule-config \\\n-\t\t\tHEAD b \\\n-\t\t\tHEAD submodule \\\n-\t\t\t\t>actual &&\n-\t\ttest_cmp expect_error actual\n-\t)\n-'\n-\n-test_expect_success 'error message contains blob reference' '\n-\t(cd super &&\n \t\tsha1=$(git rev-parse HEAD) &&\n \t\ttest-tool submodule-config \\\n \t\t\tHEAD b \\\n \t\t\tHEAD submodule \\\n-\t\t\t\t2>actual_err &&\n-\t\ttest_i18ngrep \"submodule-blob $sha1:.gitmodules\" actual_err >/dev/null\n+\t\t\t\t>actual \\\n+\t\t\t\t2>actual_stderr &&\n+\t\ttest_cmp expect_error actual &&\n+\t\ttest_i18ngrep \"submodule-blob $sha1:.gitmodules\" actual_stderr >/dev/null\n \t)\n '\n \n-- \n2.19.1\n\n"},{"id":"361540","messageId":"CAGZ79kZvzLtSgAw8epGpG+T2f2Q7z2ZkXe=4gKMQTkM8ikwcog@mail.gmail.com","threadId":"49678","inReplyTo":"20181025161813.17252-1-ao2@ao2.it","subject":"Re: [PATCH v7 00/10] Make submodules work if .gitmodules is not checked out","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-10-25T18:49:50Z","receivedAt":"2018-10-25T18:50:05Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"> In this series I am addressing the comments by Stefan Beller about the\n> tests in patch 9.\n>\n> If the new tests look OK, I'd say we try moving the series to \"next\" and\n> see what happens?\n\nSounds good to me.\n\nThanks,\nStefan\n"},{"id":"361589","messageId":"xmqqin1peadh.fsf@gitster-ct.c.googlers.com","threadId":"49678","inReplyTo":"CAGZ79kZvzLtSgAw8epGpG+T2f2Q7z2ZkXe=4gKMQTkM8ikwcog@mail.gmail.com","subject":"Re: [PATCH v7 00/10] Make submodules work if .gitmodules is not checked out","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-10-26T01:59:22Z","receivedAt":"2018-10-26T01:59:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <sbeller@google.com> writes:\n\n>> In this series I am addressing the comments by Stefan Beller about the\n>> tests in patch 9.\n>>\n>> If the new tests look OK, I'd say we try moving the series to \"next\" and\n>> see what happens?\n>\n> Sounds good to me.\n\nWhich means (1) the plan sounds OK but I didn't look at these new\ntests or (2) the new tests look OK and I am happy to see this go to\n'next'?\n\ntbdiff tells me that 9/10 is the only patch different from the\nprevious round, and I vaguely recall that the other patches looked\nOK to me (even though I admit I only skimmed them quickly).\n\nThanks.\n"},{"id":"361630","messageId":"CAGZ79katS+PHWWD_0EqSmoEFazE0vAbMsg8G+iowNfbDmMkyMg@mail.gmail.com","threadId":"49678","inReplyTo":"xmqqin1peadh.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH v7 00/10] Make submodules work if .gitmodules is not checked out","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-10-26T18:43:58Z","receivedAt":"2018-10-26T18:44:13Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Thu, Oct 25, 2018 at 6:59 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Stefan Beller <sbeller@google.com> writes:\n>\n> >> In this series I am addressing the comments by Stefan Beller about the\n> >> tests in patch 9.\n> >>\n> >> If the new tests look OK, I'd say we try moving the series to \"next\" and\n> >> see what happens?\n> >\n> > Sounds good to me.\n>\n> Which means (1) the plan sounds OK but I didn't look at these new\n> tests or (2) the new tests look OK and I am happy to see this go to\n> 'next'?\n\nI looked at the tests and found it a pleasant read, so I think the plan of\nmerging it to next and seeing what will happen is a good one.\n\nStefan\n"},{"id":"361976","messageId":"nycvar.QRO.7.76.6.1810301053540.4546@tvgsbejvaqbjf.bet","threadId":"49678","inReplyTo":"20181025161813.17252-10-ao2@ao2.it","subject":"Re: [PATCH v7 09/10] submodule: support reading .gitmodules when it's not in the working tree","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-10-30T09:57:09Z","receivedAt":"2018-10-30T09:57:15Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Antonio,\n\nOn Thu, 25 Oct 2018, Antonio Ospite wrote:\n\n> diff --git a/t/t7418-submodule-sparse-gitmodules.sh b/t/t7418-submodule-sparse-gitmodules.sh\n> new file mode 100755\n> index 0000000000..21a86b89c6\n> --- /dev/null\n> +++ b/t/t7418-submodule-sparse-gitmodules.sh\n> @@ -0,0 +1,122 @@\n> +#!/bin/sh\n> +#\n> +# Copyright (C) 2018  Antonio Ospite <ao2@ao2.it>\n> +#\n> +\n> +test_description='Test reading/writing .gitmodules when not in the working tree\n> +\n> +This test verifies that, when .gitmodules is in the current branch but is not\n> +in the working tree reading from it still works but writing to it does not.\n> +\n> +The test setup uses a sparse checkout, however the same scenario can be set up\n> +also by committing .gitmodules and then just removing it from the filesystem.\n> +'\n> +\n> +. ./test-lib.sh\n> +\n> +test_expect_success 'sparse checkout setup which hides .gitmodules' '\n> +\tgit init upstream &&\n> +\tgit init submodule &&\n> +\t(cd submodule &&\n> +\t\techo file >file &&\n> +\t\tgit add file &&\n> +\t\ttest_tick &&\n> +\t\tgit commit -m \"Add file\"\n> +\t) &&\n> +\t(cd upstream &&\n> +\t\tgit submodule add ../submodule &&\n> +\t\ttest_tick &&\n> +\t\tgit commit -m \"Add submodule\"\n> +\t) &&\n> +\tgit clone upstream super &&\n> +\t(cd super &&\n> +\t\tcat >.git/info/sparse-checkout <<-\\EOF &&\n> +\t\t/*\n> +\t\t!/.gitmodules\n> +\t\tEOF\n> +\t\tgit config core.sparsecheckout true &&\n> +\t\tgit read-tree -m -u HEAD &&\n> +\t\ttest_path_is_missing .gitmodules\n> +\t)\n> +'\n> +\n> +test_expect_success 'reading gitmodules config file when it is not checked out' '\n> +\techo \"../submodule\" >expect &&\n> +\tgit -C super submodule--helper config submodule.submodule.url >actual &&\n> +\ttest_cmp expect actual\n> +'\n> +\n> +test_expect_success 'not writing gitmodules config file when it is not checked out' '\n> +\ttest_must_fail git -C super submodule--helper config submodule.submodule.url newurl &&\n> +\ttest_path_is_missing super/.gitmodules\n> +'\n> +\n> +test_expect_success 'initialising submodule when the gitmodules config is not checked out' '\n> +\ttest_must_fail git -C super config submodule.submodule.url &&\n> +\tgit -C super submodule init &&\n> +\tgit -C super config submodule.submodule.url >actual &&\n> +\techo \"$PWD/submodule\" >expect &&\n\nWould you mind squashing this fixup in?\n\n-- snip --\ndiff --git a/t/t7418-submodule-sparse-gitmodules.sh b/t/t7418-submodule-sparse-gitmodules.sh\nindex 21a86b89c6cb..3f7f27188313 100755\n--- a/t/t7418-submodule-sparse-gitmodules.sh\n+++ b/t/t7418-submodule-sparse-gitmodules.sh\n@@ -55,7 +55,7 @@ test_expect_success 'initialising submodule when the gitmodules config is not ch\n \ttest_must_fail git -C super config submodule.submodule.url &&\n \tgit -C super submodule init &&\n \tgit -C super config submodule.submodule.url >actual &&\n-\techo \"$PWD/submodule\" >expect &&\n+\techo \"$(pwd)/submodule\" >expect &&\n \ttest_cmp expect actual\n '\n \n-- snap --\n\nOn Windows, `$PWD` and `$(pwd)` are *not* synonymous. The former\nreflects the \"Unix path\" which is understood by the Bash script (and\nonly by the Bash script, *not* by `git.exe`!) while the latter refers to\nthe actual Windows path.\n\nWithout this fix, your new test case will fail on Windows all the time,\nsee e.g.\nhttps://git-for-windows.visualstudio.com/git/_build/results?buildId=22913&view=logs\n\nThanks,\nJohannes\n\n\n> +\ttest_cmp expect actual\n> +'\n> +\n> +test_expect_success 'updating submodule when the gitmodules config is not checked out' '\n> +\ttest_path_is_missing super/submodule/file &&\n> +\tgit -C super submodule update &&\n> +\ttest_cmp submodule/file super/submodule/file\n> +'\n> +\n> +ORIG_SUBMODULE=$(git -C submodule rev-parse HEAD)\n> +ORIG_UPSTREAM=$(git -C upstream rev-parse HEAD)\n> +ORIG_SUPER=$(git -C super rev-parse HEAD)\n> +\n> +test_expect_success 're-updating submodule when the gitmodules config is not checked out' '\n> +\ttest_when_finished \"git -C submodule reset --hard $ORIG_SUBMODULE;\n> +\t\t\t    git -C upstream reset --hard $ORIG_UPSTREAM;\n> +\t\t\t    git -C super reset --hard $ORIG_SUPER;\n> +\t\t\t    git -C upstream submodule update --remote;\n> +\t\t\t    git -C super pull;\n> +\t\t\t    git -C super submodule update --remote\" &&\n> +\t(cd submodule &&\n> +\t\techo file2 >file2 &&\n> +\t\tgit add file2 &&\n> +\t\ttest_tick &&\n> +\t\tgit commit -m \"Add file2 to submodule\"\n> +\t) &&\n> +\t(cd upstream &&\n> +\t\tgit submodule update --remote &&\n> +\t\tgit add submodule &&\n> +\t\ttest_tick &&\n> +\t\tgit commit -m \"Update submodule\"\n> +\t) &&\n> +\tgit -C super pull &&\n> +\t# The --for-status options reads the gitmodules config\n> +\tgit -C super submodule summary --for-status >actual &&\n> +\trev1=$(git -C submodule rev-parse --short HEAD) &&\n> +\trev2=$(git -C submodule rev-parse --short HEAD^) &&\n> +\tcat >expect <<-EOF &&\n> +\t* submodule ${rev1}...${rev2} (1):\n> +\t  < Add file2 to submodule\n> +\n> +\tEOF\n> +\ttest_cmp expect actual &&\n> +\t# Test that the update actually succeeds\n> +\ttest_path_is_missing super/submodule/file2 &&\n> +\tgit -C super submodule update &&\n> +\ttest_cmp submodule/file2 super/submodule/file2 &&\n> +\tgit -C super status --short >output &&\n> +\ttest_must_be_empty output\n> +'\n> +\n> +test_expect_success 'not adding submodules when the gitmodules config is not checked out' '\n> +\tgit clone submodule new_submodule &&\n> +\ttest_must_fail git -C super submodule add ../new_submodule &&\n> +\ttest_path_is_missing .gitmodules\n> +'\n> +\n> +# This test checks that the previous \"git submodule add\" did not leave the\n> +# repository in a spurious state when it failed.\n> +test_expect_success 'init submodule still works even after the previous add failed' '\n> +\tgit -C super submodule init\n> +'\n> +\n> +test_done\n"},{"id":"361985","messageId":"20181030121630.0aec137f670bd5d3486cccc5@ao2.it","threadId":"49678","inReplyTo":"nycvar.QRO.7.76.6.1810301053540.4546@tvgsbejvaqbjf.bet","subject":"Re: [PATCH v7 09/10] submodule: support reading .gitmodules when it's not in the working tree","fromName":"Antonio Ospite","fromEmail":"ao2@ao2.it","sentAt":"2018-10-30T11:16:30Z","receivedAt":"2018-10-30T11:17:30Z","isPatch":true,"sender":{"key":"ao2@ao2.it","avatar":"https://avatars.githubusercontent.com/u/1249395?v=4"},"body":"On Tue, 30 Oct 2018 10:57:09 +0100 (STD)\nJohannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n\n> Hi Antonio,\n>\n\nHi Johannes,\n\n> On Thu, 25 Oct 2018, Antonio Ospite wrote:\n> \n> > diff --git a/t/t7418-submodule-sparse-gitmodules.sh b/t/t7418-submodule-sparse-gitmodules.sh\n> > new file mode 100755\n[...]\n> > +\techo \"$PWD/submodule\" >expect &&\n> \n> Would you mind squashing this fixup in?\n> \n> -- snip --\n> diff --git a/t/t7418-submodule-sparse-gitmodules.sh b/t/t7418-submodule-sparse-gitmodules.sh\n> index 21a86b89c6cb..3f7f27188313 100755\n> --- a/t/t7418-submodule-sparse-gitmodules.sh\n> +++ b/t/t7418-submodule-sparse-gitmodules.sh\n> @@ -55,7 +55,7 @@ test_expect_success 'initialising submodule when the gitmodules config is not ch\n>  \ttest_must_fail git -C super config submodule.submodule.url &&\n>  \tgit -C super submodule init &&\n>  \tgit -C super config submodule.submodule.url >actual &&\n> -\techo \"$PWD/submodule\" >expect &&\n> +\techo \"$(pwd)/submodule\" >expect &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> -- snap --\n> \n> On Windows, `$PWD` and `$(pwd)` are *not* synonymous. The former\n> reflects the \"Unix path\" which is understood by the Bash script (and\n> only by the Bash script, *not* by `git.exe`!) while the latter refers to\n> the actual Windows path.\n>\n\nI see, this is also mentioned in t/README, I had overlooked that part.\nThank you for reporting.\n\n> Without this fix, your new test case will fail on Windows all the time,\n> see e.g.\n> https://git-for-windows.visualstudio.com/git/_build/results?buildId=22913&view=logs\n> \n\nJunio, what is the plan for 'ao/submodule-wo-gitmodules-checked-out'?\nI see it's not in next yet; do you want me to resend the whole series\nwith this fixup in or would it be less overhead for you to apply it\ndirectly to patch 9/10 from v7 of the series?\n\nThank you,\n   Antonio\n\nP.S. I was wondering if it is worth having patchset versions mentioned\nsomewhere in pu/, maybe in merge commits if not in branch names?\nOr at least in whats-cooking.txt next to the date.\n\n-- \nAntonio Ospite\nhttps://ao2.it\nhttps://twitter.com/ao2it\n\nA: Because it messes up the order in which people normally read text.\n   See http://en.wikipedia.org/wiki/Posting_style\nQ: Why is top-posting such a bad thing?\n"},{"id":"362074","messageId":"xmqqftwmwt7b.fsf@gitster-ct.c.googlers.com","threadId":"49678","inReplyTo":"20181030121630.0aec137f670bd5d3486cccc5@ao2.it","subject":"Re: [PATCH v7 09/10] submodule: support reading .gitmodules when it's not in the working tree","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-10-31T06:01:12Z","receivedAt":"2018-10-31T06:01:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Antonio Ospite <ao2@ao2.it> writes:\n\n> I see, this is also mentioned in t/README, I had overlooked that part.\n> Thank you for reporting.\n>\n>> Without this fix, your new test case will fail on Windows all the time,\n>> see e.g.\n>> https://git-for-windows.visualstudio.com/git/_build/results?buildId=22913&view=logs\n>> \n>\n> Junio, what is the plan for 'ao/submodule-wo-gitmodules-checked-out'?\n>\n\nI did not and do not have a specific plan ;-) \n\nIf the only remaining issue in the previous round of the topic were\nwhat you said in <20181010205645.e1529eff9099805029b1d6ef@ao2.it>,\nwhich you addressed in this round, and given that Stefan (who is\nlikely to be the person who would need to work with you if there is\nany issues later found in this topic) seemed to be happy with it in\n<CAGZ79katS+PHWWD_0EqSmoEFazE0vAbMsg8G+iowNfbDmMkyMg@mail.gmail.com>,\nI'd say with Dscho's bug fixed, it should be ready for 'next'.\n\n> I see it's not in next yet; do you want me to resend the whole series\n> with this fixup in or would it be less overhead for you to apply it\n> directly to patch 9/10 from v7 of the series?\n\nIn either way, this involves rebuilding ao/* topic and then redoing\nsb/submodule-recursive-fetch-gets-the-tip topic on top, before I can\ndo the 'pu' with them, so I cannot promise it will happen today, but\nlet's see.  I think I have enough material to do the fix-up locally\nwithout any additional thing sent from you.\n\nThanks.\n\n\n> P.S. I was wondering if it is worth having patchset versions mentioned\n> somewhere in pu/, maybe in merge commits if not in branch names?\n\nNo, not in branch names.\n\nThe tip date published in the \"What's cooking\" report is taken from\nthe committer date but we may want to use the author date instead,\nwhich may help (and encourage people to be careful _before_ sending\nthings out, to avoid doing many rerolls in a day).\n"}]}