{"thread":{"id":"18522","subject":"[PATCH 3/5] Add option for using a foreign VCS","startedAt":"2009-03-25T03:04:12Z","lastAt":"2009-03-25T18:58:45Z","messageCount":6,"participants":["Daniel Barkalow","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"109301","messageId":"alpine.LNX.1.00.0903242303330.19665@iabervon.org","threadId":"18522","inReplyTo":null,"subject":"[PATCH 3/5] Add option for using a foreign VCS","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-03-25T03:04:12Z","receivedAt":"2009-03-25T03:04:12Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"This simply configures the remote to use a transport that doesn't have\nany methods at all and is therefore unable to do anything yet.\n\nSigned-off-by: Daniel Barkalow <barkalow@iabervon.org>\n---\n Documentation/config.txt |    4 ++++\n remote.c                 |    2 ++\n remote.h                 |    2 ++\n transport.c              |    3 ++-\n 4 files changed, 10 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 089569a..14b0e07 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1305,6 +1305,10 @@ remote.<name>.tagopt::\n \tSetting this value to \\--no-tags disables automatic tag following when\n \tfetching from remote <name>\n \n+remote.<name>.vcs::\n+\tSetting this to a value <vcs> will cause git to interact with\n+\tthe remote with the git-vcs-<vcs> helper.\n+\n remotes.<group>::\n \tThe list of remotes which are fetched by \"git remote update\n \t<group>\".  See linkgit:git-remote[1].\ndiff --git a/remote.c b/remote.c\nindex 2b037f1..be04658 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -411,6 +411,8 @@ static int handle_config(const char *key, const char *value, void *cb)\n \t} else if (!strcmp(subkey, \".proxy\")) {\n \t\treturn git_config_string((const char **)&remote->http_proxy,\n \t\t\t\t\t key, value);\n+\t} else if (!strcmp(subkey, \".vcs\")) {\n+\t\treturn git_config_string(&remote->foreign_vcs, key, value);\n \t}\n \treturn 0;\n }\ndiff --git a/remote.h b/remote.h\nindex de3d21b..e77dc1b 100644\n--- a/remote.h\n+++ b/remote.h\n@@ -11,6 +11,8 @@ struct remote {\n \tconst char *name;\n \tint origin;\n \n+\tconst char *foreign_vcs;\n+\n \tconst char **url;\n \tint url_nr;\n \tint url_alloc;\ndiff --git a/transport.c b/transport.c\nindex 26c578e..8a37db5 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -939,7 +939,8 @@ struct transport *transport_get(struct remote *remote, const char *url)\n \tret->remote = remote;\n \tret->url = url;\n \n-\tif (!prefixcmp(url, \"rsync:\")) {\n+\tif (remote && remote->foreign_vcs) {\n+\t} else if (!prefixcmp(url, \"rsync:\")) {\n \t\tret->get_refs_list = get_refs_via_rsync;\n \t\tret->fetch = fetch_objs_via_rsync;\n \t\tret->push = rsync_transport_push;\n-- \n1.6.2.1.476.g9bf04b\n"},{"id":"109323","messageId":"7v1vsm9jwd.fsf@gitster.siamese.dyndns.org","threadId":"18522","inReplyTo":"alpine.LNX.1.00.0903242303330.19665@iabervon.org","subject":"Re: [PATCH 3/5] Add option for using a foreign VCS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-25T06:49:38Z","receivedAt":"2009-03-25T06:49:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Barkalow <barkalow@iabervon.org> writes:\n\n> This simply configures the remote to use a transport that doesn't have\n> any methods at all and is therefore unable to do anything yet.\n>\n> Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>\n> ---\n>  Documentation/config.txt |    4 ++++\n>  remote.c                 |    2 ++\n>  remote.h                 |    2 ++\n>  transport.c              |    3 ++-\n>  4 files changed, 10 insertions(+), 1 deletions(-)\n>\n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index 089569a..14b0e07 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -1305,6 +1305,10 @@ remote.<name>.tagopt::\n>  \tSetting this value to \\--no-tags disables automatic tag following when\n>  \tfetching from remote <name>\n>  \n> +remote.<name>.vcs::\n> +\tSetting this to a value <vcs> will cause git to interact with\n> +\tthe remote with the git-vcs-<vcs> helper.\n> +\n\nNice.\n\n> diff --git a/remote.h b/remote.h\n> index de3d21b..e77dc1b 100644\n> --- a/remote.h\n> +++ b/remote.h\n> @@ -11,6 +11,8 @@ struct remote {\n>  \tconst char *name;\n>  \tint origin;\n>  \n> +\tconst char *foreign_vcs;\n> +\n>  \tconst char **url;\n>  \tint url_nr;\n>  \tint url_alloc;\n\nWhat are these extra blank lines for?  Isn't it pretty much part of the\nURL group that immediately follows it?\n\n> diff --git a/transport.c b/transport.c\n> index 26c578e..8a37db5 100644\n> --- a/transport.c\n> +++ b/transport.c\n> @@ -939,7 +939,8 @@ struct transport *transport_get(struct remote *remote, const char *url)\n>  \tret->remote = remote;\n>  \tret->url = url;\n>  \n> -\tif (!prefixcmp(url, \"rsync:\")) {\n> +\tif (remote && remote->foreign_vcs) {\n> +\t} else if (!prefixcmp(url, \"rsync:\")) {\n\n\tif (...) {\n        \t; /* empty */\n\t} else ...\n\n>  \t\tret->get_refs_list = get_refs_via_rsync;\n>  \t\tret->fetch = fetch_objs_via_rsync;\n>  \t\tret->push = rsync_transport_push;\n> -- \n> 1.6.2.1.476.g9bf04b\n"},{"id":"109368","messageId":"alpine.LNX.1.00.0903251042280.19665@iabervon.org","threadId":"18522","inReplyTo":"7v1vsm9jwd.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 3/5] Add option for using a foreign VCS","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-03-25T16:20:05Z","receivedAt":"2009-03-25T16:20:05Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 24 Mar 2009, Junio C Hamano wrote:\n\n> Daniel Barkalow <barkalow@iabervon.org> writes:\n> \n> > This simply configures the remote to use a transport that doesn't have\n> > any methods at all and is therefore unable to do anything yet.\n> >\n> > Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>\n> > ---\n> >  Documentation/config.txt |    4 ++++\n> >  remote.c                 |    2 ++\n> >  remote.h                 |    2 ++\n> >  transport.c              |    3 ++-\n> >  4 files changed, 10 insertions(+), 1 deletions(-)\n> >\n> > diff --git a/remote.h b/remote.h\n> > index de3d21b..e77dc1b 100644\n> > --- a/remote.h\n> > +++ b/remote.h\n> > @@ -11,6 +11,8 @@ struct remote {\n> >  \tconst char *name;\n> >  \tint origin;\n> >  \n> > +\tconst char *foreign_vcs;\n> > +\n> >  \tconst char **url;\n> >  \tint url_nr;\n> >  \tint url_alloc;\n> \n> What are these extra blank lines for?  Isn't it pretty much part of the\n> URL group that immediately follows it?\n\nI'd been thinking of it as being a higher-level switch than the URLs, but \nit could go together.\n\n> > diff --git a/transport.c b/transport.c\n> > index 26c578e..8a37db5 100644\n> > --- a/transport.c\n> > +++ b/transport.c\n> > @@ -939,7 +939,8 @@ struct transport *transport_get(struct remote *remote, const char *url)\n> >  \tret->remote = remote;\n> >  \tret->url = url;\n> >  \n> > -\tif (!prefixcmp(url, \"rsync:\")) {\n> > +\tif (remote && remote->foreign_vcs) {\n> > +\t} else if (!prefixcmp(url, \"rsync:\")) {\n> \n> \tif (...) {\n>         \t; /* empty */\n> \t} else ...\n\nI don't think I've ever tried writing an empty block for git before. It's \nbraces containing a semicolon and comment? (Of course, the reason I wrote \nthis one this way is so that the next patch could put two \"+\" lines in \nthere and have no \"-\" lines)\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"109386","messageId":"7vhc1h5vkt.fsf@gitster.siamese.dyndns.org","threadId":"18522","inReplyTo":"alpine.LNX.1.00.0903251042280.19665@iabervon.org","subject":"Re: [PATCH 3/5] Add option for using a foreign VCS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-25T18:03:14Z","receivedAt":"2009-03-25T18:03:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Barkalow <barkalow@iabervon.org> writes:\n\n>> > -\tif (!prefixcmp(url, \"rsync:\")) {\n>> > +\tif (remote && remote->foreign_vcs) {\n>> > +\t} else if (!prefixcmp(url, \"rsync:\")) {\n>> \n>> \tif (...) {\n>>         \t; /* empty */\n>> \t} else ...\n>\n> I don't think I've ever tried writing an empty block for git before. It's \n> braces containing a semicolon and comment? (Of course, the reason I wrote \n> this one this way is so that the next patch could put two \"+\" lines in \n> there and have no \"-\" lines)\n\nWasn't a serious \"this has to be the final style\" suggestion, but more\nabout \"what do you mean by this?  are you going to add more code here in\nthe later round?\" question.\n"},{"id":"109398","messageId":"alpine.LNX.1.00.0903251442200.19665@iabervon.org","threadId":"18522","inReplyTo":"7vhc1h5vkt.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 3/5] Add option for using a foreign VCS","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-03-25T18:46:14Z","receivedAt":"2009-03-25T18:46:14Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Wed, 25 Mar 2009, Junio C Hamano wrote:\n\n> Daniel Barkalow <barkalow@iabervon.org> writes:\n> \n> >> > -\tif (!prefixcmp(url, \"rsync:\")) {\n> >> > +\tif (remote && remote->foreign_vcs) {\n> >> > +\t} else if (!prefixcmp(url, \"rsync:\")) {\n> >> \n> >> \tif (...) {\n> >>         \t; /* empty */\n> >> \t} else ...\n> >\n> > I don't think I've ever tried writing an empty block for git before. It's \n> > braces containing a semicolon and comment? (Of course, the reason I wrote \n> > this one this way is so that the next patch could put two \"+\" lines in \n> > there and have no \"-\" lines)\n> \n> Wasn't a serious \"this has to be the final style\" suggestion, but more\n> about \"what do you mean by this?  are you going to add more code here in\n> the later round?\" question.\n\nAh, yes, I do intend to add code there subsequently, and this is just a \nplaceholder so that it returns a correctly-constructed struct which \ndoesn't support any operations until those operations are added.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"109399","messageId":"7vprg51lay.fsf@gitster.siamese.dyndns.org","threadId":"18522","inReplyTo":"alpine.LNX.1.00.0903251442200.19665@iabervon.org","subject":"Re: [PATCH 3/5] Add option for using a foreign VCS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-25T18:58:45Z","receivedAt":"2009-03-25T18:58:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Barkalow <barkalow@iabervon.org> writes:\n\n> On Wed, 25 Mar 2009, Junio C Hamano wrote:\n>\n>> Daniel Barkalow <barkalow@iabervon.org> writes:\n>> \n>> >> > -\tif (!prefixcmp(url, \"rsync:\")) {\n>> >> > +\tif (remote && remote->foreign_vcs) {\n>> >> > +\t} else if (!prefixcmp(url, \"rsync:\")) {\n>> >> \n>> >> \tif (...) {\n>> >>         \t; /* empty */\n>> >> \t} else ...\n>> >\n>> > I don't think I've ever tried writing an empty block for git before. It's \n>> > braces containing a semicolon and comment? (Of course, the reason I wrote \n>> > this one this way is so that the next patch could put two \"+\" lines in \n>> > there and have no \"-\" lines)\n>> \n>> Wasn't a serious \"this has to be the final style\" suggestion, but more\n>> about \"what do you mean by this?  are you going to add more code here in\n>> the later round?\" question.\n>\n> Ah, yes, I do intend to add code there subsequently, and this is just a \n> placeholder so that it returns a correctly-constructed struct which \n> doesn't support any operations until those operations are added.\n\nAh, OK, thanks.\n\nIn that case, I would say:\n\n\tif (...) {\n        \t; /* empty for now */\n\t} else ... {\n\nor even more explicit:\n\n\tif (...) {\n\t\t/*\n                 * NEEDSWORK: later when we activate nitfol,\n                 * add code to let gostak distim the doshes here.\n                 */\n        \t;\n\t} else ... {\n\nto allow people to grep for NEEDSWORK would be more appropriate.\n"}]}