git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH v2 0/3] Towards a useable git-branch
@ 2013-05-24 14:19 Ramkumar Ramachandra
  2013-05-24 14:19 ` [PATCH 1/3] for-each-ref: introduce %C(...) for color Ramkumar Ramachandra
                   ` (4 more replies)
  0 siblings, 5 replies; 31+ messages in thread
From: Ramkumar Ramachandra @ 2013-05-24 14:19 UTC (permalink / raw)
  To: Git List; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

So, while investigating alignment operators in pretty-formats, I found
out that it's way too much effort and totally not worth it (atleast
not immediately; we can add it later if we want).  What I want now is
a useable git-branch output.  And I think I can say that I've achieved
it.

I currently have hot aliased to

for-each-ref --format='%C(red)%(HEAD)%C(reset) %C(green)%(refname:short)%C(reset)%(upstream:trackshort)' --count 10 --sort='-committerdate' refs/heads

and it works beautifully for me.  Sample output:

% git hot
* hot-branch<>
  pickaxe-doc>
  publish-rev=
  publish-rev-test
  upstream-error=
  push-current-head=
  master=
  prompt=
  autostash-stash=
  rebase.autostash=

The asterisk is red, the branch names are in green, and the tracking
marker is white.

I'm very happy with the implementation too:

1. color only kicks in at the parsing layer.
2. HEAD is a new atom.
3. :track[short] is a formatp like :short.

There is no need to use a hammer and coerce everything into an atom,
or throw everything out the window and start from scratch to conform
to pretty-formats perfectly.  Let's extend the existing format to be
_useful_ sensibly.

Thanks.

Ramkumar Ramachandra (3):
  for-each-ref: introduce %C(...) for color
  for-each-ref: introduce %(HEAD) marker
  for-each-ref: introduce %(upstream:track[short])

 builtin/for-each-ref.c | 81 +++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 73 insertions(+), 8 deletions(-)

-- 
1.8.3.rc3.2.g99b8f3f.dirty

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2013-06-04 13:12 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-24 14:19 [PATCH v2 0/3] Towards a useable git-branch Ramkumar Ramachandra
2013-05-24 14:19 ` [PATCH 1/3] for-each-ref: introduce %C(...) for color Ramkumar Ramachandra
2013-05-24 20:56   ` Antoine Pelisse
2013-05-25 11:50     ` Ramkumar Ramachandra
2013-05-25 12:20       ` John Keeping
2013-05-25 12:54         ` Ramkumar Ramachandra
2013-05-25 12:35       ` Antoine Pelisse
2013-05-24 23:41   ` David Aguilar
2013-05-25 11:51     ` Ramkumar Ramachandra
2013-05-25  6:29   ` Eric Sunshine
2013-05-24 14:19 ` [PATCH 2/3] for-each-ref: introduce %(HEAD) marker Ramkumar Ramachandra
2013-05-24 20:28   ` Philip Oakley
2013-05-24 14:19 ` [PATCH 3/3] for-each-ref: introduce %(upstream:track[short]) Ramkumar Ramachandra
2013-05-24 15:27 ` [PATCH v2 0/3] Towards a useable git-branch Duy Nguyen
2013-05-24 15:58   ` Ramkumar Ramachandra
2013-05-24 17:52   ` Junio C Hamano
2013-05-24 18:01     ` Ramkumar Ramachandra
2013-05-24 18:08     ` Ramkumar Ramachandra
2013-05-24 22:51 ` Duy Nguyen
2013-05-25  6:26   ` Duy Nguyen
2013-05-25 11:35     ` Duy Nguyen
2013-05-25 11:48       ` Ramkumar Ramachandra
2013-05-28 14:01         ` Ramkumar Ramachandra
2013-05-28 14:24           ` Ramkumar Ramachandra
2013-05-30  4:19             ` Duy Nguyen
2013-06-04 12:52               ` Ramkumar Ramachandra
2013-06-04 13:11                 ` Duy Nguyen
2013-05-28 14:28           ` Ramkumar Ramachandra
2013-05-29  3:04             ` Duy Nguyen
2013-05-29 21:12               ` Ramkumar Ramachandra
2013-05-29  3:22           ` Duy Nguyen

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).