{"thread":{"id":"21475","subject":"[PATCH] Allow curl helper to work without a local repository","startedAt":"2009-11-04T02:52:35Z","lastAt":"2009-11-04T07:21:07Z","messageCount":3,"participants":["Daniel Barkalow","Sverre Rabbelier"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"126706","messageId":"alpine.LNX.2.00.0911032149390.14365@iabervon.org","threadId":"21475","inReplyTo":null,"subject":"[PATCH] Allow curl helper to work without a local repository","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-11-04T02:52:35Z","receivedAt":"2009-11-04T02:52:35Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"It's okay to use the curl helper without a local repository, so long\nas you don't use \"fetch\". There aren't any git programs that would try\nto use it, and it doesn't make sense to try it (since there's nowhere\nto write the results), but we may as well be clear.\n\nSigned-off-by: Daniel Barkalow <barkalow@iabervon.org>\n---\nThis is the simple change to let remote-curl work without a local \nrepository for git ls-remote; it leave the transport-helper code assuming \nthat all helpers can list without a local repo, which happens to be true \nof this helper, the only one in current git.\n\n remote-curl.c |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/remote-curl.c b/remote-curl.c\nindex 2faf1c6..ebdab36 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -82,9 +82,10 @@ int main(int argc, const char **argv)\n \tstruct strbuf buf = STRBUF_INIT;\n \tconst char *url;\n \tstruct walker *walker = NULL;\n+\tint nongit;\n \n \tgit_extract_argv0_path(argv[0]);\n-\tsetup_git_directory();\n+\tsetup_git_directory_gently(&nongit);\n \tif (argc < 2) {\n \t\tfprintf(stderr, \"Remote needed\\n\");\n \t\treturn 1;\n@@ -103,6 +104,8 @@ int main(int argc, const char **argv)\n \t\t\tbreak;\n \t\tif (!prefixcmp(buf.buf, \"fetch \")) {\n \t\t\tchar *obj = buf.buf + strlen(\"fetch \");\n+\t\t\tif (nongit)\n+\t\t\t\tdie(\"Fetch attempted without a local repo\");\n \t\t\tif (!walker)\n \t\t\t\twalker = get_http_walker(url, remote);\n \t\t\twalker->get_all = 1;\n-- \n1.6.5.2.142.g063c5.dirty\n"},{"id":"126715","messageId":"fabb9a1e0911032132v5e76e4b6n559169ad43d9f7c0@mail.gmail.com","threadId":"21475","inReplyTo":"alpine.LNX.2.00.0911032149390.14365@iabervon.org","subject":"Re: [PATCH] Allow curl helper to work without a local repository","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-11-04T05:32:41Z","receivedAt":"2009-11-04T05:32:41Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Wed, Nov 4, 2009 at 03:52, Daniel Barkalow <barkalow@iabervon.org> wrote:\n> This is the simple change to let remote-curl work without a local\n> repository for git ls-remote; it leave the transport-helper code assuming\n> that all helpers can list without a local repo, which happens to be true\n> of this helper, the only one in current git.\n\nAdd a capability for it? :P\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"126730","messageId":"alpine.LNX.2.00.0911040211240.14365@iabervon.org","threadId":"21475","inReplyTo":"fabb9a1e0911032132v5e76e4b6n559169ad43d9f7c0@mail.gmail.com","subject":"Re: [PATCH] Allow curl helper to work without a local repository","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-11-04T07:21:07Z","receivedAt":"2009-11-04T07:21:07Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Wed, 4 Nov 2009, Sverre Rabbelier wrote:\n\n> Heya,\n> \n> On Wed, Nov 4, 2009 at 03:52, Daniel Barkalow <barkalow@iabervon.org> wrote:\n> > This is the simple change to let remote-curl work without a local\n> > repository for git ls-remote; it leave the transport-helper code assuming\n> > that all helpers can list without a local repo, which happens to be true\n> > of this helper, the only one in current git.\n> \n> Add a capability for it? :P\n\nThat's the longer-term patch, yes. But doing anything meaningful with that \nrequires communicating down to transport-helper that we're not in a local \nrepo, which shades into reworking the whole setup/environment code. That's \nwhy I went with the easy patch for now, since it does fix the bug.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"}]}