git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Juggling between hot branches
@ 2013-09-27 12:10 Ramkumar Ramachandra
  2013-09-27 12:10 ` [PATCH 1/3] for-each-ref: introduce %C(...) for color Ramkumar Ramachandra
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Ramkumar Ramachandra @ 2013-09-27 12:10 UTC (permalink / raw)
  To: Git List; +Cc: Jonathan Nieder

Hi,

I juggle between several hot branches, and an alphabetical listing
from 'git branch' doesn't cut it for me. I've chosen to enhance
for-each-ref so that I get output like (with color):

  $ git hot
    um-build>
    perf-manifest=
  * master=
    sparse=
    ia32-asm-cleanup>
    menuconfig-jk<>
    perf-build=
    perf-completion<

where hot is the following alias:

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

While the alias might look a bit horrendous, I get the desired output.

The last time I tried to get this feature merged, there was some
confusion about unifying the format of for-each-ref with
pretty-formats, and enhacing git-branch while at it. I tried going
down that road, but got no reviews; everyone was generally more
unhappy due to the added complexity. Months have passed since, and we
still don't have this feature.

Let's keep it simple and stupid. A terse +84,-10 (with documentation)
for this wonderful feature now. Let's get it merged, and defer the
kitchen-sink-unification efforts.

Thanks.

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

 Documentation/git-for-each-ref.txt | 14 ++++++-
 builtin/for-each-ref.c             | 80 ++++++++++++++++++++++++++++++++++----
 2 files changed, 84 insertions(+), 10 deletions(-)

-- 
1.8.4.478.g55109e3

^ permalink raw reply	[flat|nested] 16+ messages in thread
* [PATCH (resend) 0/3] Minor f-e-r enhacements
@ 2013-10-31  9:46 Ramkumar Ramachandra
  2013-10-31  9:46 ` [PATCH 3/3] for-each-ref: introduce %(upstream:track[short]) Ramkumar Ramachandra
  0 siblings, 1 reply; 16+ messages in thread
From: Ramkumar Ramachandra @ 2013-10-31  9:46 UTC (permalink / raw)
  To: Git List

Hi,

I've been running git with these patches applied locally for a long
time. Although I've sent them to the list before, they've been
overlooked.

Thanks.

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

 Documentation/git-for-each-ref.txt | 14 ++++++-
 builtin/for-each-ref.c             | 75 ++++++++++++++++++++++++++++++++++----
 2 files changed, 79 insertions(+), 10 deletions(-)

-- 
1.8.5.rc0.3.gb488857

^ permalink raw reply	[flat|nested] 16+ messages in thread
* [PATCH v2 0/3] Towards a useable git-branch
@ 2013-05-24 14:19 Ramkumar Ramachandra
  2013-05-24 14:19 ` [PATCH 3/3] for-each-ref: introduce %(upstream:track[short]) Ramkumar Ramachandra
  0 siblings, 1 reply; 16+ 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] 16+ messages in thread

end of thread, other threads:[~2013-11-01 17:17 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-27 12:10 [PATCH 0/3] Juggling between hot branches Ramkumar Ramachandra
2013-09-27 12:10 ` [PATCH 1/3] for-each-ref: introduce %C(...) for color Ramkumar Ramachandra
2013-09-27 13:16   ` Phil Hord
2013-09-27 12:10 ` [PATCH 2/3] for-each-ref: introduce %(HEAD) asterisk marker Ramkumar Ramachandra
2013-09-27 12:10 ` [PATCH 3/3] for-each-ref: introduce %(upstream:track[short]) Ramkumar Ramachandra
2013-09-27 14:03   ` Phil Hord
2013-09-27 14:27     ` Ramkumar Ramachandra
2013-09-27 14:25   ` Johannes Sixt
2013-09-27 14:33     ` Ramkumar Ramachandra
2013-09-27 22:18     ` Jonathan Nieder
2013-09-27 16:06   ` Philip Oakley
2013-09-27 16:10     ` Ramkumar Ramachandra
2013-09-27 17:07       ` Philip Oakley
  -- strict thread matches above, loose matches on Subject: below --
2013-10-31  9:46 [PATCH (resend) 0/3] Minor f-e-r enhacements Ramkumar Ramachandra
2013-10-31  9:46 ` [PATCH 3/3] for-each-ref: introduce %(upstream:track[short]) Ramkumar Ramachandra
2013-11-01 17:17   ` Junio C Hamano
2013-05-24 14:19 [PATCH v2 0/3] Towards a useable git-branch Ramkumar Ramachandra
2013-05-24 14:19 ` [PATCH 3/3] for-each-ref: introduce %(upstream:track[short]) Ramkumar Ramachandra

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).