{"thread":{"id":"37714","subject":"[PATCH] remote.c - Make remote definition require a url","startedAt":"2014-10-11T15:20:49Z","lastAt":"2014-10-14T01:05:47Z","messageCount":3,"participants":["Mark Levedahl","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"250511","messageId":"1413040849-20056-1-git-send-email-mlevedahl@gmail.com","threadId":"37714","inReplyTo":null,"subject":"[PATCH] remote.c - Make remote definition require a url","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2014-10-11T15:20:49Z","receivedAt":"2014-10-11T15:20:49Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Some options may be configured globally for a remote (e.g, tagopt).\nThe presence of such options in a global config should not cause\ngit remote or get fetch to believe that remote is configured\nfor every repository. Change to require definition of remote.<foo>.url\nfor the remote to be included in \"git fetch --all\" or \"git remote\nupdate.\"\n\nSigned-off-by: Mark Levedahl <mlevedahl@gmail.com>\n---\n remote.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/remote.c b/remote.c\nindex ce785f8..1b08924 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -761,7 +761,7 @@ int for_each_remote(each_remote_fn fn, void *priv)\n \tread_config();\n \tfor (i = 0; i < remotes_nr && !result; i++) {\n \t\tstruct remote *r = remotes[i];\n-\t\tif (!r)\n+\t\tif (!r || !r->url)\n \t\t\tcontinue;\n \t\tif (!r->fetch)\n \t\t\tr->fetch = parse_fetch_refspec(r->fetch_refspec_nr,\n-- \n2.1.2.2.0.14\n"},{"id":"250543","messageId":"xmqqppdv51lv.fsf@gitster.dls.corp.google.com","threadId":"37714","inReplyTo":"1413040849-20056-1-git-send-email-mlevedahl@gmail.com","subject":"Re: [PATCH] remote.c - Make remote definition require a url","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-10-13T17:19:24Z","receivedAt":"2014-10-13T17:19:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mark Levedahl <mlevedahl@gmail.com> writes:\n\n> Some options may be configured globally for a remote (e.g, tagopt).\n\nOr some remotes may have only pushurl and not url.  \"git remote\"\noutput for me has a few such remotes but wouldn't this patch break\nit?\n\nIf a caller that walks the list of remotes misbehaves only because\nit assumes that r->url always is always valid, isn't that assumption\nwhat needs to be fixed?  for_each_remote() should be kept as a way\nto enumerate all the [remote \"foo\"], I would think.\n"},{"id":"250595","messageId":"543C76EB.1000103@gmail.com","threadId":"37714","inReplyTo":"xmqqppdv51lv.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] remote.c - Make remote definition require a url","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2014-10-14T01:05:47Z","receivedAt":"2014-10-14T01:05:47Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"On 10/13/2014 01:19 PM, Junio C Hamano wrote:\n> Mark Levedahl <mlevedahl@gmail.com> writes:\n>\n>> Some options may be configured globally for a remote (e.g, tagopt).\n> Or some remotes may have only pushurl and not url.  \"git remote\"\n> output for me has a few such remotes but wouldn't this patch break\n> it?\n>\n> If a caller that walks the list of remotes misbehaves only because\n> it assumes that r->url always is always valid, isn't that assumption\n> what needs to be fixed?  for_each_remote() should be kept as a way\n> to enumerate all the [remote \"foo\"], I would think.\n>\n>\n>\n>\nAs long as the rule is that for_each_remote will enumerate every remote \nthat has anything defined at all, even if only in the global config \noutside of a user's control, I'm not really sure how to tell whether the \nmissing url / pushurl / whatever is intentional, or a misconfiguration, \nso having the code complain that it didn't find what it wanted (the \ncurrent condition) is probably no worse than the alternatives. Patch \nwithdrawn.\n\nMark\n"}]}