From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Git List <git@vger.kernel.org>
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH v2 0/3] Towards a useable git-branch
Date: Fri, 24 May 2013 19:49:34 +0530 [thread overview]
Message-ID: <1369405177-7855-1-git-send-email-artagnon@gmail.com> (raw)
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
next reply other threads:[~2013-05-24 14:18 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-24 14:19 Ramkumar Ramachandra [this message]
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
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1369405177-7855-1-git-send-email-artagnon@gmail.com \
--to=artagnon@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.com \
/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.
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).