Re: [PATCH] push: change submodule default to check

2 messages, 2 authors, 2016-10-04 · open the first message on its own page

Re: [PATCH] push: change submodule default to check

From: Junio C Hamano <hidden>
Date: 2016-10-04 18:00:19

Stefan Beller [off-list ref] writes:
+static void preset_submodule_default(void)
+{
+	if (file_exists(".gitmodules"))
Don't we need to see if we are in a bare repository?
+		recurse_submodules = RECURSE_SUBMODULES_CHECK;
+	else
+		recurse_submodules = RECURSE_SUBMODULES_DEFAULT;
Hmph, why "_DEFAULT" not "_OFF"?
quoted hunk
+}
+
 static void add_refspec(const char *ref)
 {
 	refspec_nr++;
@@ -552,6 +560,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
 	};
 
 	packet_trace_identity("push");
+	preset_submodule_default();
 	git_config(git_push_config, &flags);
 	argc = parse_options(argc, argv, prefix, options, push_usage, 0);
 	set_push_cert_flags(&flags, push_cert);

Re: [PATCH] push: change submodule default to check

From: Stefan Beller <hidden>
Date: 2016-10-04 18:05:32

On Tue, Oct 4, 2016 at 11:00 AM, Junio C Hamano [off-list ref] wrote:
Stefan Beller [off-list ref] writes:
quoted
+static void preset_submodule_default(void)
+{
+     if (file_exists(".gitmodules"))
Don't we need to see if we are in a bare repository?
See discussion with Jeff; instead of checking the file, we rather want to check
if $GIT_DIR/modules/ is populated, as that is version agnostic
("Was a submodule initialized and fetched at any time in the
life time of this repository?"), as well as bare/non-bare agnostic.
quoted
+             recurse_submodules = RECURSE_SUBMODULES_CHECK;
+     else
+             recurse_submodules = RECURSE_SUBMODULES_DEFAULT;
Hmph, why "_DEFAULT" not "_OFF"?
You answered yourself below, and that was indeed my thought. I was
also wondering
whether to remove the else, but then I thought that we'd rather do not
want to rely on
compiled-in at all, and have one init function which sets out the new
world order.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help