From: Junio C Hamano <gitster@pobox.com>
To: Finn Arne Gangstad <finnag@pvv.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/3] git remote update: Report error for non-existing groups
Date: Wed, 08 Apr 2009 01:20:36 -0700 [thread overview]
Message-ID: <7vy6ubo8tn.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20090408080738.GA24386@pvv.org> (Finn Arne Gangstad's message of "Wed, 8 Apr 2009 10:07:38 +0200")
Finn Arne Gangstad <finnag@pvv.org> writes:
> On Tue, Apr 07, 2009 at 07:16:21PM -0700, Junio C Hamano wrote:
>> Finn Arne Gangstad <finnag@pvv.org> writes:
>>
>> > @@ -1227,8 +1229,11 @@ static int update(int argc, const char **argv)
>> >
>> > remote_group.list = &list;
>> > for (i = 1; i < argc; i++) {
>> > + int groups_found = 0;
>> > remote_group.name = argv[i];
>> > - result = git_config(get_remote_group, NULL);
>> > + result = git_config(get_remote_group, &groups_found);
>> > + if (!groups_found && (i != 1 || strcmp(argv[1], "default")))
>> > + die("No such remote group: '%s'", argv[i]);
>>
>> I think you are trying to be silent about the case where the caller feeds
>> you the default_argv[] array with this, but do we want to be more explicit
>> about this so that we do die when the end user explicitly says "default"
>> from the command line?
>
> Are you thinking that "git remote update default" should only be allowed
> if you have configured a group named default?
I have no preference either way, and that is why I asked.
"git remote update" without explicit "default" is obviously what your code
try not to say "No such remote group" to, and that probably is a sane
thing to do.
I don't know what users want to see when they say "default" explicitly
without having an explicit configuration. Should it do the same thing as
"git remote update"?
next prev parent reply other threads:[~2009-04-08 8:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-06 13:40 [PATCH 0/3] git remote update: Check args and fallback to remotes Finn Arne Gangstad
2009-04-06 13:41 ` [PATCH 1/3] git remote update: Report error for non-existing groups Finn Arne Gangstad
2009-04-08 2:16 ` Junio C Hamano
2009-04-08 8:07 ` Finn Arne Gangstad
2009-04-08 8:20 ` Junio C Hamano [this message]
2009-04-08 17:08 ` Jeff King
2009-04-08 18:48 ` Junio C Hamano
2009-04-06 13:41 ` [PATCH 2/3] remote: New function remote_is_configured() Finn Arne Gangstad
2009-04-06 13:41 ` [PATCH 3/3] git remote update: Fallback to remote if group does not exist Finn Arne Gangstad
2009-04-06 20:18 ` [PATCH 0/3] git remote update: Check args and fallback to remotes Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vy6ubo8tn.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=finnag@pvv.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).