Re: [PATCH] remote.c - Make remote definition require a url
- From
Mark Levedahl <mlevedahl@gmail.com>
- Date
- Oct 14, 2014, 01:05 UTC
- Message-ID
- <543C76EB.1000103@gmail.com>
- In-Reply-To
- <xmqqppdv51lv.fsf@gitster.dls.corp.google.com>
On 10/13/2014 01:19 PM, Junio C Hamano wrote:
Show 15 quoted lines
> Mark Levedahl <mlevedahl@gmail.com> writes: > >> Some options may be configured globally for a remote (e.g, tagopt). > Or some remotes may have only pushurl and not url. "git remote" > output for me has a few such remotes but wouldn't this patch break > it? > > If a caller that walks the list of remotes misbehaves only because > it assumes that r->url always is always valid, isn't that assumption > what needs to be fixed? for_each_remote() should be kept as a way > to enumerate all the [remote "foo"], I would think. > > > >
As long as the rule is that for_each_remote will enumerate every remote that has anything defined at all, even if only in the global config outside of a user's control, I'm not really sure how to tell whether the missing url / pushurl / whatever is intentional, or a misconfiguration, so having the code complain that it didn't find what it wanted (the current condition) is probably no worse than the alternatives. Patch withdrawn.
Mark