git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Herland <johan@herland.net>
To: git@vger.kernel.org
Cc: Daniel Barkalow <barkalow@iabervon.org>,
	gitster@pobox.com, Johan Herland <johan@herland.net>
Subject: [RFCv2 03/12] Add option for using a foreign VCS
Date: Fri, 31 Jul 2009 12:00:23 +0200	[thread overview]
Message-ID: <1249034432-31437-4-git-send-email-johan@herland.net> (raw)
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

  parent reply	other threads:[~2009-07-31 10:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-31 10:00 [RFCv2 00/12] Foreign VCS helper program for CVS repositories Johan Herland
2009-07-31 10:00 ` [RFCv2 01/12] Allow late reporting of fetched hashes Johan Herland
2009-07-31 10:00 ` [RFCv2 02/12] Document details of transport function APIs Johan Herland
2009-07-31 10:00 ` Johan Herland [this message]
2009-07-31 10:00 ` [RFCv2 04/12] Add specification of git-vcs-* helper programs Johan Herland
2009-07-31 10:00 ` [RFCv2 05/12] Use a function to determine whether a remote is valid Johan Herland
2009-07-31 10:00 ` [RFCv2 06/12] Allow programs to not depend on remotes having urls Johan Herland
2009-07-31 10:00 ` [RFCv2 07/12] Add a transport implementation using git-vcs-* helpers Johan Herland
2009-07-31 10:00 ` [RFCv2 08/12] Preliminary clarifications to git-vcs documentation Johan Herland
2009-07-31 10:00 ` [RFCv2 09/12] Teach foreign transport code to perform the "capabilities" command Johan Herland
2009-07-31 10:00 ` [RFCv2 10/12] Introduce a 'marks <filename>' feature to the foreign transport code Johan Herland
2009-07-31 10:00 ` [RFCv2 12/12] Add simple test cases of git-vcs-cvs functionality Johan Herland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1249034432-31437-4-git-send-email-johan@herland.net \
    --to=johan@herland.net \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).