[RFCv2 03/12] Add option for using a foreign VCS
- From
Johan Herland <johan@herland.net>
- Date
- Jul 31, 2009, 10:00 UTC
- Message-ID
- <1249034432-31437-4-git-send-email-johan@herland.net>
- In-Reply-To
- <1249034432-31437-1-git-send-email-johan@herland.net>
From: Daniel Barkalow <barkalow@iabervon.org>
This simply configures the remote to use a transport that doesn't have any methods at all and is therefore unable to do anything yet.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Johan Herland <johan@herland.net> --- Documentation/config.txt | 4 ++++ remote.c | 2 ++ remote.h | 2 ++ transport.c | 3 ++- 4 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt index 1446007..b4ab67b 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -1377,6 +1377,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/remote.c b/remote.c index c3ada2d..758727c 100644 --- a/remote.c +++ b/remote.c @@ -422,6 +422,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 5db8420..ac0ce2f 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; diff --git a/transport.c b/transport.c index 349ccae..f414bd3 100644 --- a/transport.c +++ b/transport.c @@ -928,7 +928,8 @@ struct transport *transport_get(struct remote *remote, const char *url) ret->remote = remote; ret->url = url; - if (!prefixcmp(url, "rsync:")) { + if (remote && remote->foreign_vcs) { + } else if (!prefixcmp(url, "rsync:")) { ret->get_refs_list = get_refs_via_rsync; ret->fetch = fetch_objs_via_rsync; ret->push = rsync_transport_push;
-- 1.6.4.rc3.138.ga6b98.dirty