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

Re: [PATCH] Show branch information in short output of git status

From
Jeff King <peff@peff.net>
Date
May 12, 2010, 13:35 UTC
Message-ID
<20100512133537.GA28956@coredump.intra.peff.net>
In-Reply-To
<AANLkTikDkrNrzPmIhmcBRKtLKV70f4Kp8wTw6I6ctB4O@mail.gmail.com>
On Thu, May 06, 2010 at 02:24:41PM +0200, Knittl wrote:
>  - initial commit is also printed when there is tracking information
> (i still haven't managed to create a situation like that. `git branch
> oldmaster; rm .git/refs/heads/master; git branch master --set-upstream
> oldmaster` will reset branch master to oldmaster (a bug?))
Try:
  git branch oldmaster
  rm .git/refs/heads/master
  git config branch.master.remote .
  git config branch.master.merge refs/heads/oldmaster

That being said, I still get "Initial commit on master". I think that stat_tracking_branch just gives up if the branch doesn't exist (which does make some sense). So in practice, I think your original and this one actually behave the same (sorry, I know that changing it was my suggestion).

And no, the "--set-upstream" behavior is not a bug. At least not according to the documentation. ;)

>  - colors to match output of `git branch` (green: current, red: remote)
>  - output format is copy-pasteable, ahead/behind information is in the
> same format as in `git branch -v`

I think it's much nicer, though the colors are a bit much for my liking. Still, it's configurable, so I don't have to care. :)

>  - branch information is still printed by default, i have to look into
> commandline option parsing first. i was thinking of `git status -v -b`
> (as in `git checkout -b` to mean branch)

You may also want to have a configuration option if it is the output you prefer all the time (similarly, if you are using "git status -s" all the time, you might want a config option to make "git status" do what you want).

Show 5 quoted lines
> ---------8<----------------
> From 82b4481d38ae0cd62030aeea67160656b7c763e2 Mon Sep 17 00:00:00 2001
> From: Daniel Knittl-Frank <knittl89+git@googlemail.com>
> Date: Tue, 20 Apr 2010 22:40:54 +0200
> Subject: [PATCH] Show branch information in short output of git status
This patch looks OK, but:
  1. I think for the final version you can just squash in part 2/2.
  2. Your patch has wrapped lines which make it impossible to apply
     without fixing up manually. This is a common gmail problem.  See
     the "gmail" section of SubmittingPatches.
-Peff
Previous: KnittlNext: Knittl
Message 5 of 13 in “Show branch information in short output of git status”
  1. Show branch information in short output of git statusKnittl, May 2, 2010
  2. Jeff KingMay 5, 2010
  3. KnittlMay 6, 2010
  4. KnittlMay 7, 2010
  5. Jeff KingMay 12, 2010
  6. KnittlMay 14, 2010
  7. Jeff KingMay 23, 2010
  8. Michael J GruberMay 25, 2010
  9. Jeff KingMay 25, 2010
  10. Michael J GruberMay 25, 2010
  11. Documentation/SubmittingPatches: clarify GMail section and SMTPMichael J Gruber, May 25, 2010
  12. Jeff KingMay 25, 2010
  13. Ævar Arnfjörð BjarmasonMay 25, 2010

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.