git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 1/3] Add "vcs" config option in remotes
@ 2009-01-11 20:12 Daniel Barkalow
  2009-01-12  1:29 ` Ping Yin
  2009-01-12  9:52 ` Bert Wesarg
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Barkalow @ 2009-01-11 20:12 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

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@iabervon.org>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH 1/3] Add "vcs" config option in remotes
  2009-01-11 20:12 [RFC PATCH 1/3] Add "vcs" config option in remotes Daniel Barkalow
@ 2009-01-12  1:29 ` Ping Yin
  2009-01-12  1:32   ` Daniel Barkalow
  2009-01-12  9:52 ` Bert Wesarg
  1 sibling, 1 reply; 5+ messages in thread
From: Ping Yin @ 2009-01-12  1:29 UTC (permalink / raw)
  To: Daniel Barkalow; +Cc: git, Junio C Hamano

On Mon, Jan 12, 2009 at 4:12 AM, Daniel Barkalow <barkalow@iabervon.org> wrote:
> 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.

s/it/if/ ?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH 1/3] Add "vcs" config option in remotes
  2009-01-12  1:29 ` Ping Yin
@ 2009-01-12  1:32   ` Daniel Barkalow
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Barkalow @ 2009-01-12  1:32 UTC (permalink / raw)
  To: Ping Yin; +Cc: git, Junio C Hamano

On Mon, 12 Jan 2009, Ping Yin wrote:

> On Mon, Jan 12, 2009 at 4:12 AM, Daniel Barkalow <barkalow@iabervon.org> wrote:
> > 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.
> 
> s/it/if/ ?

Yes. It was pretty late last night when I wrote the commit messages.

	-Daniel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH 1/3] Add "vcs" config option in remotes
  2009-01-11 20:12 [RFC PATCH 1/3] Add "vcs" config option in remotes Daniel Barkalow
  2009-01-12  1:29 ` Ping Yin
@ 2009-01-12  9:52 ` Bert Wesarg
  2009-01-12 17:25   ` Daniel Barkalow
  1 sibling, 1 reply; 5+ messages in thread
From: Bert Wesarg @ 2009-01-12  9:52 UTC (permalink / raw)
  To: Daniel Barkalow; +Cc: git, Junio C Hamano

On Sun, Jan 11, 2009 at 21:12, Daniel Barkalow <barkalow@iabervon.org> wrote:
> 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);
>
Use of remote before NULL check.

Bert

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH 1/3] Add "vcs" config option in remotes
  2009-01-12  9:52 ` Bert Wesarg
@ 2009-01-12 17:25   ` Daniel Barkalow
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Barkalow @ 2009-01-12 17:25 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: git, Junio C Hamano

On Mon, 12 Jan 2009, Bert Wesarg wrote:

> On Sun, Jan 11, 2009 at 21:12, Daniel Barkalow <barkalow@iabervon.org> wrote:
> > 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);
> >
> Use of remote before NULL check.

Good catch, thanks.

	-Daniel
*This .sig left intentionally blank*

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-01-12 17:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-11 20:12 [RFC PATCH 1/3] Add "vcs" config option in remotes Daniel Barkalow
2009-01-12  1:29 ` Ping Yin
2009-01-12  1:32   ` Daniel Barkalow
2009-01-12  9:52 ` Bert Wesarg
2009-01-12 17:25   ` Daniel Barkalow

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).