{"thread":{"id":"17097","subject":"[RFC PATCH 1/3] Add \"vcs\" config option in remotes","startedAt":"2009-01-11T20:12:05Z","lastAt":"2009-01-12T17:25:52Z","messageCount":5,"participants":["Daniel Barkalow","Ping Yin","Bert Wesarg"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"99995","messageId":"alpine.LNX.1.00.0901110332580.19665@iabervon.org","threadId":"17097","inReplyTo":null,"subject":"[RFC PATCH 1/3] Add \"vcs\" config option in remotes","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-01-11T20:12:05Z","receivedAt":"2009-01-11T20:12:05Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"This will indicate to programs using the remote that it should be\naccessed through a VCS helper. Until programs support it, have them\nfail it the option is set.\n\nClone doesn't have a way to end up with a foreign remote, and I didn't \ntouch \"git remote\".\n\nSigned-off-by: Daniel Barkalow <barkalow@iabervon.org>\n---\n Documentation/config.txt |    4 ++++\n builtin-fetch.c          |    4 ++++\n builtin-ls-remote.c      |    2 ++\n builtin-push.c           |    3 +++\n remote.c                 |    2 ++\n remote.h                 |    2 ++\n 6 files changed, 17 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 7408bb2..3159e8c 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1205,6 +1205,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/builtin-fetch.c b/builtin-fetch.c\nindex de6f307..7b46f8f 100644\n--- a/builtin-fetch.c\n+++ b/builtin-fetch.c\n@@ -635,6 +635,10 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n \telse\n \t\tremote = remote_get(argv[0]);\n \n+\tif (remote->foreign_vcs) {\n+\t\tdie(\"Using foreign VCSes for fetch is not yet supported.\");\n+\t}\n+\n \ttransport = transport_get(remote, remote->url[0]);\n \tif (verbosity >= 2)\n \t\ttransport->verbose = 1;\ndiff --git a/builtin-ls-remote.c b/builtin-ls-remote.c\nindex 78a88f7..d910be9 100644\n--- a/builtin-ls-remote.c\n+++ b/builtin-ls-remote.c\n@@ -87,6 +87,8 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)\n \t\t}\n \t}\n \tremote = nongit ? NULL : remote_get(dest);\n+\tif (remote && remote->foreign_vcs)\n+\t\tdie(\"ls-remote not supported for foreign VCSes\");\n \tif (remote && !remote->url_nr)\n \t\tdie(\"remote %s has no configured URL\", dest);\n \ttransport = transport_get(remote, remote ? remote->url[0] : dest);\ndiff --git a/builtin-push.c b/builtin-push.c\nindex 122fdcf..3fdedba 100644\n--- a/builtin-push.c\n+++ b/builtin-push.c\n@@ -53,6 +53,9 @@ static int do_push(const char *repo, int flags)\n \tint i, errs;\n \tstruct remote *remote = remote_get(repo);\n \n+\tif (remote->foreign_vcs)\n+\t\tdie(\"Pushing with foreign VCSes not supported.\");\n+\n \tif (!remote)\n \t\tdie(\"bad repository '%s'\", repo);\n \ndiff --git a/remote.c b/remote.c\nindex 570e112..02135ce 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -406,6 +406,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 a46a5be..625c7de 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-- \n1.6.0.6\n"},{"id":"100047","messageId":"46dff0320901111729y3869db2bxcc2b66a7be247d0b@mail.gmail.com","threadId":"17097","inReplyTo":"alpine.LNX.1.00.0901110332580.19665@iabervon.org","subject":"Re: [RFC PATCH 1/3] Add \"vcs\" config option in remotes","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2009-01-12T01:29:01Z","receivedAt":"2009-01-12T01:29:01Z","isPatch":true,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"On Mon, Jan 12, 2009 at 4:12 AM, Daniel Barkalow <barkalow@iabervon.org> wrote:\n> This will indicate to programs using the remote that it should be\n> accessed through a VCS helper. Until programs support it, have them\n> fail it the option is set.\n\ns/it/if/ ?\n"},{"id":"100049","messageId":"alpine.LNX.1.00.0901112032100.19665@iabervon.org","threadId":"17097","inReplyTo":"46dff0320901111729y3869db2bxcc2b66a7be247d0b@mail.gmail.com","subject":"Re: [RFC PATCH 1/3] Add \"vcs\" config option in remotes","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-01-12T01:32:36Z","receivedAt":"2009-01-12T01:32:36Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Mon, 12 Jan 2009, Ping Yin wrote:\n\n> On Mon, Jan 12, 2009 at 4:12 AM, Daniel Barkalow <barkalow@iabervon.org> wrote:\n> > This will indicate to programs using the remote that it should be\n> > accessed through a VCS helper. Until programs support it, have them\n> > fail it the option is set.\n> \n> s/it/if/ ?\n\nYes. It was pretty late last night when I wrote the commit messages.\n\n\t-Daniel\n"},{"id":"100096","messageId":"36ca99e90901120152t7756e6d4n19521cbb7336c5fb@mail.gmail.com","threadId":"17097","inReplyTo":"alpine.LNX.1.00.0901110332580.19665@iabervon.org","subject":"Re: [RFC PATCH 1/3] Add \"vcs\" config option in remotes","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2009-01-12T09:52:04Z","receivedAt":"2009-01-12T09:52:04Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"On Sun, Jan 11, 2009 at 21:12, Daniel Barkalow <barkalow@iabervon.org> wrote:\n> diff --git a/builtin-push.c b/builtin-push.c\n> index 122fdcf..3fdedba 100644\n> --- a/builtin-push.c\n> +++ b/builtin-push.c\n> @@ -53,6 +53,9 @@ static int do_push(const char *repo, int flags)\n>        int i, errs;\n>        struct remote *remote = remote_get(repo);\n>\n> +       if (remote->foreign_vcs)\n> +               die(\"Pushing with foreign VCSes not supported.\");\n> +\n>        if (!remote)\n>                die(\"bad repository '%s'\", repo);\n>\nUse of remote before NULL check.\n\nBert\n"},{"id":"100138","messageId":"alpine.LNX.1.00.0901121225330.19665@iabervon.org","threadId":"17097","inReplyTo":"36ca99e90901120152t7756e6d4n19521cbb7336c5fb@mail.gmail.com","subject":"Re: [RFC PATCH 1/3] Add \"vcs\" config option in remotes","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-01-12T17:25:52Z","receivedAt":"2009-01-12T17:25:52Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Mon, 12 Jan 2009, Bert Wesarg wrote:\n\n> On Sun, Jan 11, 2009 at 21:12, Daniel Barkalow <barkalow@iabervon.org> wrote:\n> > diff --git a/builtin-push.c b/builtin-push.c\n> > index 122fdcf..3fdedba 100644\n> > --- a/builtin-push.c\n> > +++ b/builtin-push.c\n> > @@ -53,6 +53,9 @@ static int do_push(const char *repo, int flags)\n> >        int i, errs;\n> >        struct remote *remote = remote_get(repo);\n> >\n> > +       if (remote->foreign_vcs)\n> > +               die(\"Pushing with foreign VCSes not supported.\");\n> > +\n> >        if (!remote)\n> >                die(\"bad repository '%s'\", repo);\n> >\n> Use of remote before NULL check.\n\nGood catch, thanks.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"}]}