git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC PATCH 1/3] Add "vcs" config option in remotes

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Jan 11, 2009, 20:12 UTC
Message-ID
<alpine.LNX.1.00.0901110332580.19665@iabervon.org>

This will indicate to programs using the remote that it should be accessed through a VCS helper. Until programs support it, have them fail it the option is set.

Clone doesn't have a way to end up with a foreign remote, and I didn't touch "git remote".

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
---
 Documentation/config.txt |    4 ++++
 builtin-fetch.c          |    4 ++++
 builtin-ls-remote.c      |    2 ++
 builtin-push.c           |    3 +++
 remote.c                 |    2 ++
 remote.h                 |    2 ++
 6 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 7408bb2..3159e8c 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1205,6 +1205,10 @@ remote.<name>.tagopt::
 	Setting this value to \--no-tags disables automatic tag following when
 	fetching from remote <name>
 
+remote.<name>.vcs::
+	Setting this to a value <vcs> will cause git to interact with
+	the remote with the git-vcs-<vcs> helper.
+
 remotes.<group>::
 	The list of remotes which are fetched by "git remote update
 	<group>".  See linkgit:git-remote[1].
diff --git a/builtin-fetch.c b/builtin-fetch.c
index de6f307..7b46f8f 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -635,6 +635,10 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
 	else
 		remote = remote_get(argv[0]);
 
+	if (remote->foreign_vcs) {
+		die("Using foreign VCSes for fetch is not yet supported.");
+	}
+
 	transport = transport_get(remote, remote->url[0]);
 	if (verbosity >= 2)
 		transport->verbose = 1;
diff --git a/builtin-ls-remote.c b/builtin-ls-remote.c
index 78a88f7..d910be9 100644
--- a/builtin-ls-remote.c
+++ b/builtin-ls-remote.c
@@ -87,6 +87,8 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
 		}
 	}
 	remote = nongit ? NULL : remote_get(dest);
+	if (remote && remote->foreign_vcs)
+		die("ls-remote not supported for foreign VCSes");
 	if (remote && !remote->url_nr)
 		die("remote %s has no configured URL", dest);
 	transport = transport_get(remote, remote ? remote->url[0] : dest);
diff --git a/builtin-push.c b/builtin-push.c
index 122fdcf..3fdedba 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -53,6 +53,9 @@ static int do_push(const char *repo, int flags)
 	int i, errs;
 	struct remote *remote = remote_get(repo);
 
+	if (remote->foreign_vcs)
+		die("Pushing with foreign VCSes not supported.");
+
 	if (!remote)
 		die("bad repository '%s'", repo);
 
diff --git a/remote.c b/remote.c
index 570e112..02135ce 100644
--- a/remote.c
+++ b/remote.c
@@ -406,6 +406,8 @@ static int handle_config(const char *key, const char *value, void *cb)
 	} else if (!strcmp(subkey, ".proxy")) {
 		return git_config_string((const char **)&remote->http_proxy,
 					 key, value);
+	} else if (!strcmp(subkey, ".vcs")) {
+		return git_config_string(&remote->foreign_vcs, key, value);
 	}
 	return 0;
 }
diff --git a/remote.h b/remote.h
index a46a5be..625c7de 100644
--- a/remote.h
+++ b/remote.h
@@ -11,6 +11,8 @@ struct remote {
 	const char *name;
 	int origin;
 
+	const char *foreign_vcs;
+
 	const char **url;
 	int url_nr;
 	int url_alloc;
-- 
1.6.0.6
Next: Ping Yin
Message 1 of 5 in “Add "vcs" config option in remotes”
  1. 1/3 Add "vcs" config option in remotesDaniel Barkalow, Jan 11, 2009
  2. Ping YinJan 12, 2009
  3. Daniel BarkalowJan 12, 2009
  4. Bert WesargJan 12, 2009
  5. Daniel BarkalowJan 12, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.