# [RFC] git branch --status ?

3 messages from 2010-05-03 to 2010-05-03. Participants: Cheng Renquan, Michael J Gruber.
Thread: https://gitlist.dev/t/23684

## Cheng Renquan, 2010-05-03 18:31

Subject: [RFC] git branch --status ?
Message-ID: <p2i91b13c311005031131vc876475fn674c0ceffbdb3cf6@mail.gmail.com>
URL: https://gitlist.dev/e/p2i91b13c311005031131vc876475fn674c0ceffbdb3cf6%40mail.gmail.com

```
Hi, all,
  I'm considering to do a feature patch that is useful for this scenario:

$ git remote -v update
Updating geko-ceph
From git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
 = [up to date]      for-linus  -> geko-ceph/for-linus
 = [up to date]      for-next   -> geko-ceph/for-next
 = [up to date]      master     -> geko-ceph/master
 = [up to date]      rbd        -> geko-ceph/rbd
 = [up to date]      unstable   -> geko-ceph/unstable
Updating newd-ceph
From git://ceph.newdream.net/ceph-client
 = [up to date]      addr_cleanup -> newd-ceph/addr_cleanup
 = [up to date]      auth       -> newd-ceph/auth
 = [up to date]      bookkeeper -> newd-ceph/bookkeeper
 = [up to date]      cephdev    -> newd-ceph/cephdev
 = [up to date]      for-next   -> newd-ceph/for-next
 = [up to date]      master     -> newd-ceph/master
 = [up to date]      msgr       -> newd-ceph/msgr
 = [up to date]      osd-timeout -> newd-ceph/osd-timeout
 = [up to date]      pgcache    -> newd-ceph/pgcache
 = [up to date]      pgcache2   -> newd-ceph/pgcache2
 = [up to date]      pgcache3   -> newd-ceph/pgcache3
 = [up to date]      rbd        -> newd-ceph/rbd
 = [up to date]      rbd2       -> newd-ceph/rbd2
 = [up to date]      reconnect  -> newd-ceph/reconnect
 = [up to date]      unstable   -> newd-ceph/unstable
 = [up to date]      upstream   -> newd-ceph/upstream

after this kind of remote update, usually we want to know:
1) which remote branch is the latest? (then know which branch is most valuable)
2) the latest commit information of every branch (remote & local) ?

I'd like to use "git branch -a --status" to achieve this feature,
something like:

$ git branch -a --status

git branch -a
  master [%h %an %ad %s]
* new33 [%h %an %ad %s]
  remotes/geko-ceph/for-linus [%h %an %ad %s]
  remotes/geko-ceph/for-next ...
  remotes/geko-ceph/master ...
  remotes/geko-ceph/rbd
  remotes/geko-ceph/unstable
  remotes/newd-ceph/addr_cleanup
  remotes/newd-ceph/auth

So now for everyone here,
1) how do you think it's useful?
2) if some current command with some switches has done the goal?
   (then I don't need to implement it,)
2) if not; which command switch (other than "branch --status") do you prefer?
3) implementation suggestions?

Thanks & Cheers,

--
Cheng Renquan (程任全), Singapore

```

## Michael J Gruber, 2010-05-03 19:54

Subject: Re: [RFC] git branch --status ?
Message-ID: <4BDF2A02.1050907@drmicha.warpmail.net>
URL: https://gitlist.dev/e/4BDF2A02.1050907%40drmicha.warpmail.net
In-Reply-To: <p2i91b13c311005031131vc876475fn674c0ceffbdb3cf6@mail.gmail.com>

```
Cheng Renquan venit, vidit, dixit 03.05.2010 20:31:
> Hi, all,
>   I'm considering to do a feature patch that is useful for this scenario:
> 
> $ git remote -v update
> Updating geko-ceph
> From git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
>  = [up to date]      for-linus  -> geko-ceph/for-linus
>  = [up to date]      for-next   -> geko-ceph/for-next
>  = [up to date]      master     -> geko-ceph/master
>  = [up to date]      rbd        -> geko-ceph/rbd
>  = [up to date]      unstable   -> geko-ceph/unstable
> Updating newd-ceph
> From git://ceph.newdream.net/ceph-client
>  = [up to date]      addr_cleanup -> newd-ceph/addr_cleanup
>  = [up to date]      auth       -> newd-ceph/auth
>  = [up to date]      bookkeeper -> newd-ceph/bookkeeper
>  = [up to date]      cephdev    -> newd-ceph/cephdev
>  = [up to date]      for-next   -> newd-ceph/for-next
>  = [up to date]      master     -> newd-ceph/master
>  = [up to date]      msgr       -> newd-ceph/msgr
>  = [up to date]      osd-timeout -> newd-ceph/osd-timeout
>  = [up to date]      pgcache    -> newd-ceph/pgcache
>  = [up to date]      pgcache2   -> newd-ceph/pgcache2
>  = [up to date]      pgcache3   -> newd-ceph/pgcache3
>  = [up to date]      rbd        -> newd-ceph/rbd
>  = [up to date]      rbd2       -> newd-ceph/rbd2
>  = [up to date]      reconnect  -> newd-ceph/reconnect
>  = [up to date]      unstable   -> newd-ceph/unstable
>  = [up to date]      upstream   -> newd-ceph/upstream
> 
> after this kind of remote update, usually we want to know:
> 1) which remote branch is the latest? (then know which branch is most valuable)
> 2) the latest commit information of every branch (remote & local) ?
> 
> I'd like to use "git branch -a --status" to achieve this feature,
> something like:
> 
> $ git branch -a --status
> 
> git branch -a
>   master [%h %an %ad %s]
> * new33 [%h %an %ad %s]
>   remotes/geko-ceph/for-linus [%h %an %ad %s]
>   remotes/geko-ceph/for-next ...
>   remotes/geko-ceph/master ...
>   remotes/geko-ceph/rbd
>   remotes/geko-ceph/unstable
>   remotes/newd-ceph/addr_cleanup
>   remotes/newd-ceph/auth
> 
> So now for everyone here,
> 1) how do you think it's useful?
> 2) if some current command with some switches has done the goal?
>    (then I don't need to implement it,)
> 2) if not; which command switch (other than "branch --status") do you prefer?
> 3) implementation suggestions?
> 
> Thanks & Cheers,
> 
> --
> Cheng Renquan (程任全), Singapore

You may mean something like

git log --no-walk --format="%d [%h %an %ad %s]" --branches

although Jeff will tell you to use

git for-each-ref --format="%(refname:short) [%(objectname) %(authorname)
%(authordate) %(subject)]" refs/heads

and will probably know how to abbreviate the objectname here ;)

Cheers,
Michael

```

## Cheng Renquan, 2010-05-03 21:03

Subject: Re: [RFC] git branch --status ?
Message-ID: <t2s91b13c311005031403h37c5e066va6870a3ae0a79420@mail.gmail.com>
URL: https://gitlist.dev/e/t2s91b13c311005031403h37c5e066va6870a3ae0a79420%40mail.gmail.com
In-Reply-To: <4BDF2A02.1050907@drmicha.warpmail.net>

```
On Tue, May 4, 2010 at 3:54 AM, Michael J Gruber
<git@drmicha.warpmail.net> wrote:
> You may mean something like
>
> git log --no-walk --format="%d [%h %an %ad %s]" --branches
>
> although Jeff will tell you to use
>
> git for-each-ref --format="%(refname:short) [%(objectname) %(authorname)
> %(authordate) %(subject)]" refs/heads

changed to refs/remotes, it works well, thanks,

git for-each-ref --format='%(refname:short)%09[%(objectname)
%(authorname) %(authordate:relative) %(subject)]' refs/remotes

> and will probably know how to abbreviate the objectname here ;)
>
> Cheers,
> Michael
>

--
Cheng Renquan (程任全), Singapore

```
