public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha•warpmail.net>
To: Jeff King <peff@peff•net>
Cc: git@vger•kernel.org, Junio C Hamano <gitster@pobox•com>,
	Michael Schubert <mschub@elegosoft•com>
Subject: Re: [PATCH 0/5] RFC: patterns for branch list
Date: Fri, 26 Aug 2011 10:30:41 +0200	[thread overview]
Message-ID: <4E5759B1.50705@drmicha.warpmail.net> (raw)
In-Reply-To: <20110825175301.GC519@sigill.intra.peff.net>

Jeff King venit, vidit, dixit 25.08.2011 19:53:
> On Thu, Aug 25, 2011 at 10:30:16AM +0200, Michael J Gruber wrote:
> 
>> This mini series is about introducing patterns to the list mode of
>> 'git branch' much like the pattern for 'git tag -l'. There are several
>> related things which are to be considered for the ui design:
> 
>> [log vs tag vs branch]
> 
> I agree that the ideal UI change would be to move git-branch's "-l" to
> "-g", and make "-l|--list" work the same as it does for git-tag.
> 
> Even though branch is generally considered a porcelain, I worry a little
> about making that change. A script that wants to create a branch has no
> real choice other than to use "git branch" (OK, they can use
> "update-ref" themselves, but I seriously doubt that most scripts do so).
> However, I kind of doubt anyone actually uses "-l"; it is mostly
> pointless in the default config, so maybe it is safe.
> 
> Searching google code for "git.branch.*-l" turns up only one hit, and it
> is somebody who apparently thought that "-l" meant "list".

;)

Thanks for doing the search.

>> Analogous to "git tag", "branch" has several modes, one of which is list mode.
>> It is currently activated (and possibly modified) by "-v" and "-vv", and when
>> there are no arguments. So, at the least,
>>
>> git branch -v[v] <pattern>
>>
>> should match just like "git tag -l <pattern>" does. And that is what the first
>> patch in my series does.
> 
> The order of your patches seems backwards to me. You add
> pattern-matching for "-v", but there is no way to get pattern-matching
> for the non-verbose case. Shouldn't "--list" come first?
> 
> Maybe I am just nitpicking, as I think the end result after the series
> is the same. I just found the first patch very confusing.

It's an RFC series to revive the discussion about what to aim for.
Agreement about "--list" seems to be growing, so a natural first patch
would introduce that.

>> "git tag" should probably learn the same long option and others. And why not
>> verify tags given by a pattern?
> 
> Yeah, having them both do --list makes sense. Whether it is appropriate
> to glob for other operations, I don't know. I think you'd have to
> look at each operation individually.
> 
>> Both "tag" and "branch" could activate list mode automatically on an invalid
>> tag name rather than dieing:
>>
>> git tag v1.7.6\*
>> Warning: tag 'v1.7.6*' not found.
>> v1.7.6
>> v1.7.6-rc0
>> v1.7.6-rc1
>> v1.7.6-rc2
>> v1.7.6-rc3
>> v1.7.6.1
> 
> That just seems confusing to me. What is the exit status? Shouldn't the
> warning be "error: tag 'v1.7.6*' is not a valid tag name"?

Sure, and sorry, copied the wrong one. I'd just like to have the simple
way to say "git branch peff/\*" at least as long as we don't have "-l"
for "--list".

>> -v[v] sanity
>> ============
>>
>> '-v' and '-vv' both take considerable time (because they need to walk).
>> It makes more sense to have '-v' display cheap output (upstream name)
>> and '-vv' add expensive output (ahead/behind info). '-vvv' could add super
>> expensive info (ahead/equivalent/behind a la cherry-mark).
> 
> I think the original rationale was not so much "how much time does it
> take", but rather "how much space do you want each line to take on your
> terminal". For many people, the upstream name in "-vv" is just
> cluttering noise.

According to my experience, the ahead/behind computations take so much
time (in a git.git clone with my devel branches) that they render all
"-v" versions unusable, unless I use a restrictive pattern.

On the other hand, I have branches based on all of origin/{master,next}
and others, so having the upstream name is valuable.

Seems that I'm an outlier, though.

> Tag and branch listing are really just specialized versions of
> for-each-ref. I wonder if it makes sense to do:
> 
>   1. Teach for-each-ref formats replacement tokens for ahead/behind
>      counts.
> 
>   2. Let the user specify a for-each-ref format for tag and branch
>      listing output. Then the various levels of "-v" just become some
>      special format strings, and the user is free to ask for whatever
>      they want (or even have "branch.defaultListFormat" to get it
>      without typing over and over).

for-each-peff ;)

For a moment, the use of the walker in builtin/branch.c even tricked me
into thinking that it might not use for-each-ref at all. God forbid!

I actually like the format suggestion. Then we only need to discuss the
default format, which is hopefully less of a problem. But that is
something for later, I'll discard the -v[v[v]] patches for now. Have we
unified log formats and for-each-ref formats and parsers already, btw? I
recall some efforts.

Michael

  reply	other threads:[~2011-08-26  8:30 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-02 17:17 [RFC] branch: list branches by single remote Michael Schubert
2011-08-04  4:06 ` Jeff King
2011-08-16 13:37   ` Michael J Gruber
2011-08-16 14:19     ` Michael Schubert
2011-08-16 15:14     ` Jeff King
2011-08-24 15:14       ` Michael Schubert
2011-08-24 15:37         ` Michael J Gruber
2011-08-24 16:02           ` Michael Schubert
2011-08-24 18:34           ` Junio C Hamano
2011-08-25  2:31             ` Thiago Farina
2011-08-25 18:02               ` Junio C Hamano
2011-08-25  8:29             ` Michael J Gruber
2011-08-25  8:30               ` [PATCH 0/5] RFC: patterns for branch list Michael J Gruber
2011-08-25  8:30                 ` [PATCH 1/5] branch: allow pattern arguments Michael J Gruber
2011-08-25 17:54                   ` Jeff King
2011-08-25 18:32                     ` Junio C Hamano
2011-08-25 19:29                       ` Junio C Hamano
2011-08-25  8:30                 ` [PATCH 2/5] branch: introduce --list argument Michael J Gruber
2011-08-25 18:34                   ` Junio C Hamano
2011-08-25 19:52                   ` Junio C Hamano
2011-08-25  8:30                 ` [PATCH 3/5] t6040; test branch -vv Michael J Gruber
2011-08-25  8:30                 ` [PATCH 4/5] branch: restructure -v vs. -vv Michael J Gruber
2011-08-25 19:02                   ` Junio C Hamano
2011-08-25  8:30                 ` [PATCH 5/5] branch: give patchsame count with -vvv Michael J Gruber
2011-08-25 17:53                 ` [PATCH 0/5] RFC: patterns for branch list Jeff King
2011-08-26  8:30                   ` Michael J Gruber [this message]
2011-08-26 16:55                     ` Junio C Hamano
2011-09-07 19:53                       ` Jeff King
2011-09-08  9:20                         ` Michael J Gruber
2011-08-26 14:05                   ` [PATCHv2 0/5] " Michael J Gruber
2011-08-26 14:05                     ` [PATCHv2 1/5] t6040: test branch -vv Michael J Gruber
2011-08-26 14:05                     ` [PATCHv2 2/5] git-tag: introduce long forms for the options Michael J Gruber
2011-08-26 17:11                       ` Junio C Hamano
2011-08-28 14:03                         ` Michael J Gruber
2011-08-26 14:05                     ` [PATCHv2 3/5] git-branch: introduce missing " Michael J Gruber
2011-08-26 17:13                       ` Junio C Hamano
2011-08-28 14:05                         ` Michael J Gruber
2011-08-26 14:05                     ` [PATCHv2 4/5] branch: introduce --list option Michael J Gruber
2011-08-26 17:43                       ` Junio C Hamano
2011-08-28 14:37                         ` Michael J Gruber
2011-09-07 19:56                           ` Jeff King
2011-09-08  9:24                             ` Michael J Gruber
2011-09-08 14:25                               ` [PATCHv4 0/5] mg/branch-list amendment Michael J Gruber
2011-09-08 14:25                                 ` [PATCHv4 4/5] branch: introduce --list option Michael J Gruber
2011-09-08 14:25                                 ` [PATCHv4 5/5] branch: allow pattern arguments Michael J Gruber
2011-09-08 21:03                               ` [PATCHv2 4/5] branch: introduce --list option Junio C Hamano
2011-09-08 21:11                                 ` Jeff King
2011-09-08 21:17                                 ` Junio C Hamano
2011-09-09  1:08                                   ` Jeff King
2011-09-09  6:54                                   ` Michael J Gruber
2011-09-09 16:02                                     ` Junio C Hamano
2011-09-09 19:29                                       ` Michael J Gruber
2011-09-09 19:30                                         ` Jeff King
2011-09-09 19:40                                           ` [PATCH] t3200: test branch creation with -v Michael J Gruber
2011-09-09 19:43                                             ` Jeff King
2011-09-09 19:45                                               ` Jeff King
2011-09-10 13:29                                               ` Michael J Gruber
2011-09-13  3:57                                                 ` Jeff King
2011-09-13 12:12                                                   ` Michael J Gruber
2011-09-13 16:13                                                     ` [PATCH] t3200: clean up checks for file existence Jeff King
2011-09-13 17:13                                                       ` Junio C Hamano
2011-09-13 17:16                                                         ` Jeff King
2011-08-26 14:05                     ` [PATCHv2 5/5] branch: allow pattern arguments Michael J Gruber
2011-08-26 18:45                       ` Junio C Hamano
2011-08-28 14:54                     ` [PATCHv3 0/5] patterns for branch list Michael J Gruber
2011-08-28 14:54                       ` [PATCHv3 1/5] t6040: test branch -vv Michael J Gruber
2011-08-28 14:54                       ` [PATCHv3 2/5] git-tag: introduce long forms for the options Michael J Gruber
2011-08-28 14:54                       ` [PATCHv3 3/5] git-branch: introduce missing " Michael J Gruber
2011-08-28 14:54                       ` [PATCHv3 4/5] branch: introduce --list option Michael J Gruber
2011-08-29  5:55                         ` Junio C Hamano
2011-08-29  6:35                           ` Michael J Gruber
2011-08-29  6:51                             ` Junio C Hamano
2011-08-28 14:54                       ` [PATCHv3 5/5] branch: allow pattern arguments Michael J Gruber
2011-09-06 13:10                         ` Michael Schubert
2011-09-06 14:21                           ` Michael J Gruber
2011-09-06 14:26                             ` Sverre Rabbelier
2011-09-06 16:11                               ` Michael J Gruber

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=4E5759B1.50705@drmicha.warpmail.net \
    --to=git@drmicha$(echo .)warpmail.net \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=mschub@elegosoft$(echo .)com \
    --cc=peff@peff$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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