From: Michael J Gruber <git@drmicha.warpmail.net>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
Michael Schubert <mschub@elegosoft.com>
Subject: [PATCH 0/5] RFC: patterns for branch list
Date: Thu, 25 Aug 2011 10:30:16 +0200 [thread overview]
Message-ID: <cover.1314259226.git.git@drmicha.warpmail.net> (raw)
In-Reply-To: <4E5607E0.1050300@drmicha.warpmail.net>
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:
git log
=======
For "log" and friends, "--glob" is a means to specify revision arguments by
matching refs. Note that we have
--branches[=<pattern>] matching in refs/heads
--tags[=<pattern>] matching in refs/tags
--glob=<glob-pattern> matching in refs/
git tag
=======
For "tag", we have a pattern matching in refs/tags, but only in the list mode
of "tag", which is invoked by "-l", or automatically when there are no
arguments. There is no pattern related option, it's "always on" in list mode.
I.e., in list mode it behaves much like
git log --no-walk --oneline --tags=
with a different format string, and an optional argument stuck at the end of
the line. (git for-each-ref is another related interface, but plumbing, so I'll
skip it here.)
git branch
==========
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.
Then we need an option to invoke list mode. The natural candidate "-l" is taken
by the badly named reflog option, which is why I suggested "--list" and moving
the reflog option to "-g" over time.
I'm open to other suggestions as long as they keep and improve the consistency
between "git tag" and "git branch". I never liked their different implicit
modes/subcommands but have been around long enough to know that they are there
to stay.
"git tag" should probably learn the same long option and others. And why not
verify tags given by a pattern?
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
On the other hand, one might think about implementing both list modes (tag and
branch) using the revision machinery and custom format strings, or
for-each-ref; rather than both differently as it is now.
'-l' is the natural short option name for '--list'. This is taken for the
rarely used or needed 'create reflog' option. I'd change the latter to
'-g,--create-reflog' (cmp. log) and take '-l,--list' but know the reaction
already.
-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).
These are changes to current porcelain ui behaviour, so I deem this to be OK
(too late for 1.7.7, of course). The option renaming needs a transition
(not done in this series).
Michael J Gruber (5):
branch: allow pattern arguments
branch: introduce --list argument
t6040; test branch -vv [independent, can go in as is testing current behaviour]
branch: restructure -v vs. -vv
branch: give patchsame count with -vvv
Documentation/git-branch.txt | 20 +++++++++---
builtin/branch.c | 65 +++++++++++++++++++++++++----------------
remote.c | 12 ++++++--
remote.h | 2 +-
t/t3203-branch-output.sh | 24 +++++++++++++++
t/t6040-tracking-info.sh | 41 ++++++++++++++++++++++++--
wt-status.c | 2 +-
7 files changed, 127 insertions(+), 39 deletions(-)
--
1.7.6.845.gc3c05
next prev parent reply other threads:[~2011-08-25 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 ` Michael J Gruber [this message]
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
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=cover.1314259226.git.git@drmicha.warpmail.net \
--to=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mschub@elegosoft.com \
--cc=peff@peff.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).