git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: demerphq <demerphq@gmail.com>
Cc: Sverre Rabbelier <srabbelier@gmail.com>,
	Tim Visher <tim.visher@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: `Git Status`-like output for two local branches
Date: Wed, 9 Sep 2009 08:26:02 -0400	[thread overview]
Message-ID: <20090909122602.GA31208@coredump.intra.peff.net> (raw)
In-Reply-To: <9b18b3110909050758k597f917fn3baefa5fdb4741a0@mail.gmail.com>

On Sat, Sep 05, 2009 at 04:58:36PM +0200, demerphq wrote:

> It would be useful in for instance prompt status line. At $work we
> have a number of people using a prompt that includes the result of
> parsing git-status, but something --left-right-count would be much
> nicer, and if i understand it, more efficient (although maybe im
> wrong). In the prompt they use a number of different unicode arrows to
> show what has happened, with a Y type thing for diverged.

Well, if they are using the other bits of "git status" then it may not
be that inefficient compared to a "--left-right-count".

However, it sounds like they are not actually interested in the count,
but just the two bits of information: is A ahead of B, and is B ahead of
A (and then displaying one of four symbols as a result).

And getting that information is even more efficient than just a count,
because you don't have to traverse all of the commits. Though you do
still have to find the merge base, so I'm not sure how much you would be
saving in practice.

A "--left-right-count" does feel like an odd option to "git log" or "git
rev-list", as you are no longer logging or listing anything. In a way,
it makes more sense to me as a special output format of "git
merge-base".

Anyway, I think your example sounds like a reasonable application.
Personally, I do not use a git-enhanced prompt, so it is not my itch to
scratch (and I think a plumbing patch would only make sense if it was a
stepping stone to an actual application, which means somebody needs to
write the actual application).

-Peff

      reply	other threads:[~2009-09-09 12:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-31 20:20 `Git Status`-like output for two local branches Tim Visher
2009-09-02  7:57 ` Jeff King
2009-09-02  8:18   ` Sverre Rabbelier
2009-09-05  8:17     ` Jeff King
2009-09-05 14:58       ` demerphq
2009-09-09 12:26         ` Jeff King [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=20090909122602.GA31208@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=demerphq@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=srabbelier@gmail.com \
    --cc=tim.visher@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).