From: Jeff King <peff@peff.net>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: Johannes Sixt <j.sixt@viscovery.net>,
Junio C Hamano <gitster@pobox.com>,
Boris Faure <billiob@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH/RFC] branch: add optional parameter to -r to specify remote
Date: Mon, 20 Jun 2011 09:09:45 -0400 [thread overview]
Message-ID: <20110620130945.GA19011@sigill.intra.peff.net> (raw)
In-Reply-To: <4DFF2A1D.3060206@drmicha.warpmail.net>
On Mon, Jun 20, 2011 at 01:08:13PM +0200, Michael J Gruber wrote:
> > For that matter, --match should be spelled "--glob", as we already have:
> >
> > $ git log --glob='jk/*'
> >
> > I think having the ref-selection for "git branch" match that of the
> > revision walker makes sense.
>
> Well, "branch" is about refs, and "log" about revs.
Sure, and I wouldn't expect "git branch --list 1234abcd" to do anything
useful. But naming refs is a subset of naming revs. Certainly it seems
worth it to make the shorthands like "--remotes" behave the same way
where applicable.
I do agree that "git branch -l 'jk/*'" is less typing than "--glob"; it
may be worth supporting both forms to provide the least surprise to the
user (i.e., even though it may not be the shortest, users may expect the
same syntax to work in both places, and it costs us very little to
accept either).
> I'd rather have
> "branch" similar to "tag" in that respect (i.e. '-l'). I'm still meaning
> to revive that series:
>
> http://permalink.gmane.org/gmane.comp.version-control.git/172228
Modulo Junio's comments on the "-l" transition, I like the idea. One
thing jumped out at me:
> - else if (argc == 0)
> - return print_ref_list(kinds, detached, verbose, abbrev, with_commit);
> + else if (argc == 0 || (verbose && argc == 1))
> + return print_ref_list(kinds, detached, verbose, abbrev, with_commit, argc ? argv[0] : NULL);
Is there any reason not to accept:
git branch --list jk/* mg/*
? For "tag -l", we seem to silently ignore any arguments past the first:
$ git tag -l 'v1.7.4.*' 'v1.7.5.*'
v1.7.4.1
v1.7.4.2
v1.7.4.3
v1.7.4.4
v1.7.4.5
We should at least warn and say "your second argument is being ignored"
or show the usage message. But perhaps it is even friendlier to accept
a list of patterns.
-Peff
next prev parent reply other threads:[~2011-06-20 13:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-19 19:19 [PATCH/RFC] branch: add optional parameter to -r to specify remote Boris Faure
2011-06-19 19:19 ` Boris Faure
2011-06-19 22:32 ` Junio C Hamano
2011-06-20 6:40 ` Johannes Sixt
2011-06-20 7:03 ` Jeff King
2011-06-20 11:08 ` Michael J Gruber
2011-06-20 13:09 ` Jeff King [this message]
2011-06-20 15:42 ` Junio C Hamano
2011-06-20 16:59 ` [PATCH] tag: accept multiple patterns for --list Jeff King
2011-06-20 15:49 ` [PATCH/RFC] branch: add optional parameter to -r to specify remote Junio C Hamano
2011-06-20 15:39 ` Junio C Hamano
2011-06-20 19:12 ` Boris Faure
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=20110620130945.GA19011@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=billiob@gmail.com \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.net \
/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).