git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: John Tapsell <johnflux@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: Improving git branch
Date: Wed, 17 Dec 2014 12:51:36 -0800	[thread overview]
Message-ID: <xmqqzjam80fb.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAHQ6N+qBUcBcG8RC6Co+k_GmJDXCynmyfZmvTjz4bQyH1wG3DA@mail.gmail.com> (John Tapsell's message of "Wed, 17 Dec 2014 11:10:10 +0000")

John Tapsell <johnflux@gmail.com> writes:

>   I'm interested in putting in some time and effort into improving the
> output of "git branch".
>
>   What I'm thinking is an output like this:
>
> $ git branch
>
> 2014-12-17 * (detached from origin/master)     deaba04 Do stuff
> 2014-12-15   john.ta/add_timing_info                6edbcfa  Add timing stuff
> 2014-12-14   master                                          8537316
> [origin/master: ahead 1, behind 16] Some stuff
> 2014-12-12   john.ta/new_reduce_memory       99d84db Reintroduce: memory stuff
> 2014-12-05   john.ta/bugfixes                            e15c95e Add stuff
> 2014-12-03   john.ta/container                           e9fd4e5 This
> branch is a test bed for containers
>
>
> (These columns are supposed to be all aligned nicely..)
>
> So, features:
>
> 1. Show the date of the last commit
> 2. Sort by date.  Most recently used branches at the top
> 3. Show the branch name, including your current "branch", with a * to
> indicate that it's checked out.
> 4. Show the sha
> 5. Show the branch DESCRIPTION - and if that's not available, show the
> short-line of the most recent commit.
>
> There is also a small amount of color here that I can't paste here, to
> follow the coloring in the current git branch.
>
> Before I start making patches etc, what do people think?  Would I have
> a chance of getting this in?  Should I change some aspects etc?

Three random points:

 * A single output format can never be favourite of everybody, so
   this needs to be more like

	$ git branch --format='%(committerdate) %(refname) %(subject)'

   optionally with branch.format configuration variable to let the
   user specify the default.

 * I am not sure if the "current" marker should be anywhere but the
   frontmost column in the recommended default.  The output from the
   command obviously is not meant for machine processing
   (e.g. sorting or grepping), so this point is minor, though.

 * I do not think the object name should take valuable screen real
   estate, again in the built-in default (I wouldn't mind people
   hurting themselves with their configuration at all ;-).  After
   looking at "git branch --pretty-long" output, people can give any
   command john.ta/bugfixes instead of e15c95e, no?

      parent reply	other threads:[~2014-12-17 20:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-17 11:10 Improving git branch John Tapsell
2014-12-17 11:28 ` Michael J Gruber
2014-12-17 11:51   ` John Tapsell
2014-12-17 12:23     ` Michael J Gruber
2014-12-17 20:53   ` Junio C Hamano
2014-12-17 21:01     ` Jeff King
2014-12-21 16:36       ` Moritz Neeb
2014-12-18 10:05     ` Michael J Gruber
2014-12-17 20:51 ` Junio C Hamano [this message]

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=xmqqzjam80fb.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=johnflux@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.
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).