{"thread":{"id":"20843","subject":"[PATCH 6/8] Add a config option for remotes to specify a foreign vcs","startedAt":"2009-09-04T02:13:59Z","lastAt":"2009-09-04T02:13:59Z","messageCount":1,"participants":["Daniel Barkalow"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"122381","messageId":"alpine.LNX.2.00.0909032213310.28290@iabervon.org","threadId":"20843","inReplyTo":null,"subject":"[PATCH 6/8] Add a config option for remotes to specify a foreign vcs","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-09-04T02:13:59Z","receivedAt":"2009-09-04T02:13:59Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"If this is set, the url is not required, and the transport always uses\na helper named \"git-remote-<value>\".\n\nIt is a separate configuration option in order to allow a sensible\nconfiguration for foreign systems which either have no meaningful urls\nfor repositories or which require urls that do not specify the system\nused by the repository at that location. However, this only affects\nhow the name of the helper is determined, not anything about the\ninteraction with the helper, and the contruction is such that, if the\nforeign scm does happen to use a co-named url method, a url with that\nmethod may be used directly.\n\nSigned-off-by: Daniel Barkalow <barkalow@iabervon.org>\n---\n Documentation/config.txt |    4 ++++\n remote.c                 |    4 +++-\n remote.h                 |    2 ++\n transport.c              |    5 +++++\n 4 files changed, 14 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 5256c7f..436ee91 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1380,6 +1380,10 @@ remote.<name>.tagopt::\n \tSetting this value to \\--no-tags disables automatic tag following when\n \tfetching from remote <name>\n \n+remote.<name>.vcs::\n+\tSetting this to a value <vcs> will cause git to interact with\n+\tthe remote with the git-remote-<vcs> helper.\n+\n remotes.<group>::\n \tThe list of remotes which are fetched by \"git remote update\n \t<group>\".  See linkgit:git-remote[1].\ndiff --git a/remote.c b/remote.c\nindex fec63fa..e9dbb3b 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -50,7 +50,7 @@ static char buffer[BUF_SIZE];\n \n static int valid_remote(const struct remote *remote)\n {\n-\treturn !!remote->url;\n+\treturn !remote->url != !remote->foreign_vcs;\n }\n \n static const char *alias_url(const char *url)\n@@ -427,6 +427,8 @@ static int handle_config(const char *key, const char *value, void *cb)\n \t} else if (!strcmp(subkey, \".proxy\")) {\n \t\treturn git_config_string((const char **)&remote->http_proxy,\n \t\t\t\t\t key, value);\n+\t} else if (!strcmp(subkey, \".vcs\")) {\n+\t\treturn git_config_string(&remote->foreign_vcs, key, value);\n \t}\n \treturn 0;\n }\ndiff --git a/remote.h b/remote.h\nindex 5db8420..ac0ce2f 100644\n--- a/remote.h\n+++ b/remote.h\n@@ -11,6 +11,8 @@ struct remote {\n \tconst char *name;\n \tint origin;\n \n+\tconst char *foreign_vcs;\n+\n \tconst char **url;\n \tint url_nr;\n \tint url_alloc;\ndiff --git a/transport.c b/transport.c\nindex 684fd6c..38bebe3 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -818,6 +818,11 @@ struct transport *transport_get(struct remote *remote, const char *url)\n \t\turl = remote->url[0];\n \tret->url = url;\n \n+\tif (remote && remote->foreign_vcs) {\n+\t\ttransport_helper_init(ret, remote->foreign_vcs);\n+\t\treturn ret;\n+\t}\n+\n \tif (!prefixcmp(url, \"rsync:\")) {\n \t\tret->get_refs_list = get_refs_via_rsync;\n \t\tret->fetch = fetch_objs_via_rsync;\n-- \n1.6.4.2.419.gc86f8\n"}]}