git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFC] branch: add optional parameter to -r to specify remote

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 20, 2011, 15:39 UTC
Message-ID
<7v62o0eckx.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20110620070316.GA15246@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 15 quoted lines
> On Mon, Jun 20, 2011 at 08:40:32AM +0200, Johannes Sixt wrote:
>
>> > 	$ git branch --match "jk/*"
>> > 
>> > to show only local topic branches whose names match the given blob.
>> 
>> I would hate having to learn a new syntax '--match "jk/*"' when we can
>> already say
>> 
>>     $ git log --remotes
>>     $ git log --remotes=alice --remotes=bob
>>     $ git log --remotes="jk/*"
>> 
>> IMO, it is the right approach to have a long option --remotes with an
>> optional argument.

Yeah, it was just me being sloppy. I didn't mean to suggest a brand new option name "--match"; I was merely saying that it should be something that specifies filtering. Except for the last one, if you are naming remotes, that also would make sense.

But not the last one at least in the context of the example I gave in my message. I wanted to see local topic branches whose names match jk/* so using --remotes is actively wrong.

Show 6 quoted lines
> 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.

Yes, again I was just being sloppy and did not mean to introduce a brand new --match; --glob indeed is a lot more appropriate in the examples I gave in the message.

Here are two other examples of "listing" mode of the branch command:
	$ git branch --no-merged --glob="jc/*" pu
	$ git branch --with jc/some-topic --glob="maint-*" --glob=maint
I sometimes wish if they had such filtering.
Previous: Junio C HamanoNext: Boris Faure
Message 11 of 12 in “branch: add optional parameter to -r to specify remote”
  1. branch: add optional parameter to -r to specify remoteBoris Faure, Jun 19, 2011
  2. branch: add optional parameter to -r to specify remoteBoris Faure, Jun 19, 2011
  3. Junio C HamanoJun 19, 2011
  4. Johannes SixtJun 20, 2011
  5. Jeff KingJun 20, 2011
  6. Michael J GruberJun 20, 2011
  7. Jeff KingJun 20, 2011
  8. Junio C HamanoJun 20, 2011
  9. tag: accept multiple patterns for --listJeff King, Jun 20, 2011
  10. Junio C HamanoJun 20, 2011
  11. Junio C HamanoJun 20, 2011
  12. Boris FaureJun 20, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.