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@xxxxxxxxxxxx> --- 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 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html