git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 3/5] Add option for using a foreign VCS
@ 2009-03-25  3:04 Daniel Barkalow
  2009-03-25  6:49 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Barkalow @ 2009-03-25  3:04 UTC (permalink / raw
  To: Junio C Hamano; +Cc: git

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>
---
 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 089569a..14b0e07 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1305,6 +1305,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 2b037f1..be04658 100644
--- a/remote.c
+++ b/remote.c
@@ -411,6 +411,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 de3d21b..e77dc1b 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 26c578e..8a37db5 100644
--- a/transport.c
+++ b/transport.c
@@ -939,7 +939,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.2.1.476.g9bf04b

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

* Re: [PATCH 3/5] Add option for using a foreign VCS
  2009-03-25  3:04 [PATCH 3/5] Add option for using a foreign VCS Daniel Barkalow
@ 2009-03-25  6:49 ` Junio C Hamano
  2009-03-25 16:20   ` Daniel Barkalow
  0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2009-03-25  6:49 UTC (permalink / raw
  To: Daniel Barkalow; +Cc: git

Daniel Barkalow <barkalow@iabervon.org> writes:

> 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>
> ---
>  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 089569a..14b0e07 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -1305,6 +1305,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.
> +

Nice.

> diff --git a/remote.h b/remote.h
> index de3d21b..e77dc1b 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;

What are these extra blank lines for?  Isn't it pretty much part of the
URL group that immediately follows it?

> diff --git a/transport.c b/transport.c
> index 26c578e..8a37db5 100644
> --- a/transport.c
> +++ b/transport.c
> @@ -939,7 +939,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:")) {

	if (...) {
        	; /* empty */
	} else ...

>  		ret->get_refs_list = get_refs_via_rsync;
>  		ret->fetch = fetch_objs_via_rsync;
>  		ret->push = rsync_transport_push;
> -- 
> 1.6.2.1.476.g9bf04b

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

* Re: [PATCH 3/5] Add option for using a foreign VCS
  2009-03-25  6:49 ` Junio C Hamano
@ 2009-03-25 16:20   ` Daniel Barkalow
  2009-03-25 18:03     ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Barkalow @ 2009-03-25 16:20 UTC (permalink / raw
  To: Junio C Hamano; +Cc: git

On Tue, 24 Mar 2009, Junio C Hamano wrote:

> Daniel Barkalow <barkalow@iabervon.org> writes:
> 
> > 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>
> > ---
> >  Documentation/config.txt |    4 ++++
> >  remote.c                 |    2 ++
> >  remote.h                 |    2 ++
> >  transport.c              |    3 ++-
> >  4 files changed, 10 insertions(+), 1 deletions(-)
> >
> > diff --git a/remote.h b/remote.h
> > index de3d21b..e77dc1b 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;
> 
> What are these extra blank lines for?  Isn't it pretty much part of the
> URL group that immediately follows it?

I'd been thinking of it as being a higher-level switch than the URLs, but 
it could go together.

> > diff --git a/transport.c b/transport.c
> > index 26c578e..8a37db5 100644
> > --- a/transport.c
> > +++ b/transport.c
> > @@ -939,7 +939,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:")) {
> 
> 	if (...) {
>         	; /* empty */
> 	} else ...

I don't think I've ever tried writing an empty block for git before. It's 
braces containing a semicolon and comment? (Of course, the reason I wrote 
this one this way is so that the next patch could put two "+" lines in 
there and have no "-" lines)

	-Daniel
*This .sig left intentionally blank*

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

* Re: [PATCH 3/5] Add option for using a foreign VCS
  2009-03-25 16:20   ` Daniel Barkalow
@ 2009-03-25 18:03     ` Junio C Hamano
  2009-03-25 18:46       ` Daniel Barkalow
  0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2009-03-25 18:03 UTC (permalink / raw
  To: Daniel Barkalow; +Cc: git

Daniel Barkalow <barkalow@iabervon.org> writes:

>> > -	if (!prefixcmp(url, "rsync:")) {
>> > +	if (remote && remote->foreign_vcs) {
>> > +	} else if (!prefixcmp(url, "rsync:")) {
>> 
>> 	if (...) {
>>         	; /* empty */
>> 	} else ...
>
> I don't think I've ever tried writing an empty block for git before. It's 
> braces containing a semicolon and comment? (Of course, the reason I wrote 
> this one this way is so that the next patch could put two "+" lines in 
> there and have no "-" lines)

Wasn't a serious "this has to be the final style" suggestion, but more
about "what do you mean by this?  are you going to add more code here in
the later round?" question.

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

* Re: [PATCH 3/5] Add option for using a foreign VCS
  2009-03-25 18:03     ` Junio C Hamano
@ 2009-03-25 18:46       ` Daniel Barkalow
  2009-03-25 18:58         ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Barkalow @ 2009-03-25 18:46 UTC (permalink / raw
  To: Junio C Hamano; +Cc: git

On Wed, 25 Mar 2009, Junio C Hamano wrote:

> Daniel Barkalow <barkalow@iabervon.org> writes:
> 
> >> > -	if (!prefixcmp(url, "rsync:")) {
> >> > +	if (remote && remote->foreign_vcs) {
> >> > +	} else if (!prefixcmp(url, "rsync:")) {
> >> 
> >> 	if (...) {
> >>         	; /* empty */
> >> 	} else ...
> >
> > I don't think I've ever tried writing an empty block for git before. It's 
> > braces containing a semicolon and comment? (Of course, the reason I wrote 
> > this one this way is so that the next patch could put two "+" lines in 
> > there and have no "-" lines)
> 
> Wasn't a serious "this has to be the final style" suggestion, but more
> about "what do you mean by this?  are you going to add more code here in
> the later round?" question.

Ah, yes, I do intend to add code there subsequently, and this is just a 
placeholder so that it returns a correctly-constructed struct which 
doesn't support any operations until those operations are added.

	-Daniel
*This .sig left intentionally blank*

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

* Re: [PATCH 3/5] Add option for using a foreign VCS
  2009-03-25 18:46       ` Daniel Barkalow
@ 2009-03-25 18:58         ` Junio C Hamano
  0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2009-03-25 18:58 UTC (permalink / raw
  To: Daniel Barkalow; +Cc: git

Daniel Barkalow <barkalow@iabervon.org> writes:

> On Wed, 25 Mar 2009, Junio C Hamano wrote:
>
>> Daniel Barkalow <barkalow@iabervon.org> writes:
>> 
>> >> > -	if (!prefixcmp(url, "rsync:")) {
>> >> > +	if (remote && remote->foreign_vcs) {
>> >> > +	} else if (!prefixcmp(url, "rsync:")) {
>> >> 
>> >> 	if (...) {
>> >>         	; /* empty */
>> >> 	} else ...
>> >
>> > I don't think I've ever tried writing an empty block for git before. It's 
>> > braces containing a semicolon and comment? (Of course, the reason I wrote 
>> > this one this way is so that the next patch could put two "+" lines in 
>> > there and have no "-" lines)
>> 
>> Wasn't a serious "this has to be the final style" suggestion, but more
>> about "what do you mean by this?  are you going to add more code here in
>> the later round?" question.
>
> Ah, yes, I do intend to add code there subsequently, and this is just a 
> placeholder so that it returns a correctly-constructed struct which 
> doesn't support any operations until those operations are added.

Ah, OK, thanks.

In that case, I would say:

	if (...) {
        	; /* empty for now */
	} else ... {

or even more explicit:

	if (...) {
		/*
                 * NEEDSWORK: later when we activate nitfol,
                 * add code to let gostak distim the doshes here.
                 */
        	;
	} else ... {

to allow people to grep for NEEDSWORK would be more appropriate.

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

end of thread, other threads:[~2009-03-25 19:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-25  3:04 [PATCH 3/5] Add option for using a foreign VCS Daniel Barkalow
2009-03-25  6:49 ` Junio C Hamano
2009-03-25 16:20   ` Daniel Barkalow
2009-03-25 18:03     ` Junio C Hamano
2009-03-25 18:46       ` Daniel Barkalow
2009-03-25 18:58         ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).