Skip to content

submodule--helper credential.* pass into submodule

Jacob Keller git 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest7 patches 14 repliesIn review
  2. v43 patches 5 repliesSuperseded

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7t/lib-httpd: load mod_unixdt/lib-httpd/apache.conf+3 -00 replies
2/7submodule: don't pass empty string arguments to submodule--helper clonegit-submodule.sh+2 -21 reply
3/7submodule: check argc count for git submodule--helper clonebuiltin/submodule--helper.c+4 -01 reply
4/7submodule: fix submodule--helper clone usagebuiltin/submodule--helper.c+1 -11 reply
5/7submodule: fix segmentation fault in submodule--helper clonebuiltin/submodule--helper.c+3 -32 replies
6/7quote: implement sq_quotef()quote.c quote.h+16 -00 replies
7/7git: submodule honor -c credential.* from command linebuiltin/submodule--helper.c git-submodule.sh t/t5550-http-fetch-dumb.sh +1 more+133 -1414 replies

Reviews trailers per patch

4 of 7 patches have a Reviewed-by or Acked-by.

PatchStefan BellerJonathan Nieder
1/7
2/7R-b
3/7R-b
4/7R-b
5/7
6/7
7/7R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 0/7] submodule--helper credential.* pass into submodule

From: Jacob Keller <[email protected]>

This series implements ability to pass the credential.* configuration variables from the command line directly into the submodule. The other patches in this series are small fixups noticed along the way.

--> Interdiff between v5 and v6 <--

builtin/submodule--helper.c +9 -8
index 43943eef81b4..3d37c3f1822d 100644
@@ -140,18 +140,18 @@ static int submodule_config_ok(const char *var)
 
 static int sanitize_submodule_config(const char *var, const char *value, void *data)
 {
-	struct strbuf quoted = STRBUF_INIT;
 	struct strbuf *out = data;
 
 	if (submodule_config_ok(var)) {
 		if (out->len)
 			strbuf_addch(out, ' ');
 
-		sq_quotef(out, "%s=%s", var, value);
+		if (value)
+			sq_quotef(out, "%s=%s", var, value);
+		else
+			sq_quote_buf(out, var);
 	}
 
-	strbuf_release(&quoted);
-
 	return 0;
 }
 
@@ -235,16 +235,17 @@ static int module_clone(int argc, const char **argv, const char *prefix)
 
 	const char *const git_submodule_helper_usage[] = {
 		N_("git submodule--helper clone [--prefix=<path>] [--quiet] "
-		   "[--reference <repository>] [--name <name>] [--url <url>]"
-		   "[--depth <depth>] [--path <path>]"),
+		   "[--reference <repository>] [--name <name>] [--depth <depth>] "
+		   "--url <url> --path <path>"),
 		NULL
 	};
 
 	argc = parse_options(argc, argv, prefix, module_clone_options,
 			     git_submodule_helper_usage, 0);
 
-	if (argc)
-		usage(*git_submodule_helper_usage);
+	if (argc || !url || !path)
+		usage_with_options(git_submodule_helper_usage,
+				   module_clone_options);
 
 	strbuf_addf(&sb, "%s/modules/%s", get_git_dir(), name);
 	sm_gitdir = strbuf_detach(&sb, NULL);

Jacob Keller (6):
submodule: don't pass empty string arguments to submodule--helper
clone
submodule: check argc count for git submodule--helper clone
submodule: fix submodule--helper clone usage
submodule: fix segmentation fault in submodule--helper clone
quote: implement sq_quotef()
git: submodule honor -c credential.* from command line

Michael J Gruber (1):
t/lib-httpd: load mod_unixd

 builtin/submodule--helper.c  | 76 ++++++++++++++++++++++++++++++++++++++++++--
 git-submodule.sh             | 40 ++++++++++++++---------
 quote.c                      | 13 ++++++++
 quote.h                      |  3 ++
 t/lib-httpd/apache.conf      |  3 ++
 t/t5550-http-fetch-dumb.sh   | 17 ++++++++++
 t/t7412-submodule--helper.sh | 26 +++++++++++++++
 7 files changed, 160 insertions(+), 18 deletions(-)
 create mode 100755 t/t7412-submodule--helper.sh
Signature · 1 line
2.7.1.429.g45cd78e