{"thread":{"id":"19533","subject":"[PATCH 5/7] Add a config option for remotes to specify a foreign vcs","startedAt":"2009-05-27T18:15:45Z","lastAt":"2009-05-27T18:15:45Z","messageCount":1,"participants":["Daniel Barkalow"],"isPatch":true,"patchVersion":1,"patchTotal":7},"messages":[{"id":"114820","messageId":"alpine.LNX.2.00.0905271409040.2147@iabervon.org","threadId":"19533","inReplyTo":null,"subject":"[PATCH 5/7] Add a config option for remotes to specify a foreign vcs","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-05-27T18:15:45Z","receivedAt":"2009-05-27T18:15:45Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"This can be used instead of a url in a valid remote configuration, but\nthe resulting transport cannot do anything.\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              |    4 ++++\n 4 files changed, 13 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 2c03162..d6c6c9c 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1347,6 +1347,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-vcs-<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 5552ce7..168b0ce 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@@ -416,6 +416,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 99706a8..a234b37 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 b9f1f6e..011a8dc 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -938,6 +938,10 @@ struct transport *transport_get(struct remote *remote, const char *url)\n \n \tret->remote = remote;\n \n+\tif (remote && remote->foreign_vcs) {\n+\t\treturn ret;\n+\t}\n+\n \tif (!url && remote)\n \t\turl = remote->url[0];\n \tret->url = url;\n-- \n1.6.0.6\n"}]}