git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-prompt.sh: make '+' work for unborn branches

From
Jeff King <peff@peff.net>
Date
Mar 27, 2014, 23:08 UTC
Message-ID
<20140327230811.GD32434@sigill.intra.peff.net>
In-Reply-To
<CABbCQwskqZzzRXm5K3dnOfRoAcx8jpsdskngmN7f1EvY6BONgw@mail.gmail.com>
On Thu, Mar 06, 2014 at 10:16:47PM +0100, Maurice Bos wrote:
Show 6 quoted lines
> I have no clue why git diff --cached isn't used instead of git diff-index.
> I was wondering about it, but I decided I don't know enough about git and
> there are probably valid reasons for doing it this way. Though, replacing
> it with with git diff --cached seems to have the exact same behaviour, as
> far as I tested. That would make the patch a little prettier, as it doesn't
> contain the empty tree id any more:

I think it probably goes in the wrong direction, though. The prompt code should probably be building on plumbing, not porcelain. So your original patch as-is is probably the most sensible thing (we may want to convert the first git-diff call to use plumbing, too, but that would be a separate patch).

It looks like Junio did not pick up your patch. You may want to repost it.

-Peff
Previous: Maurice Bos
Message 3 of 3 in “git-prompt.sh: make '+' work for unborn branches”
  1. git-prompt.sh: make '+' work for unborn branchesMaurice Bos, Mar 5, 2014
  2. Maurice BosMar 6, 2014
  3. Jeff KingMar 27, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.