Re: [PATCH/WIP 0/9] for-each-ref format improvements

2013-05-21 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > This series introduces: > > - %(current), which either shows "*" if the ref is pointed by HEAD >or a space. Junio called it %(headness). I don't like that. >I don't like %(current) either but we have to start somewhere. >Name suggestion? %(marker)?? "

Re: [PATCH/WIP 0/9] for-each-ref format improvements

2013-05-19 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > Originally I wanted to introduce --pretty with git-log's pretty syntax > to for-each-ref, deprecating --format. If you are going to unify the two mechanisms, I think the "--format" option of "for-each-ref" needs to become a superset of what the "--pretty" option o

Re: [PATCH/WIP 0/9] for-each-ref format improvements

2013-05-19 Thread Ramkumar Ramachandra
Duy Nguyen wrote: > I don't think you can easily borrow parsing code from pretty-formats > (but I may be wrong). Anyway new stuff with new syntax would look > alien in for-each-ref format lines. Either we bring --pretty to > for-each-ref, leaving all for-each-ref atoms behind in --format, or we > s

Re: [PATCH/WIP 0/9] for-each-ref format improvements

2013-05-19 Thread Duy Nguyen
On Sun, May 19, 2013 at 7:08 PM, Ramkumar Ramachandra wrote: >> "branch -vv" shows [upstream: ahead x, behind y]. We need a syntax to >> cover that too. > > Can't we construct that using [%(upstream:short): %(upstream:diff)]? > It's nothing fundamental. If there is no upstream, [] should not be s

Re: [PATCH/WIP 0/9] for-each-ref format improvements

2013-05-19 Thread Ramkumar Ramachandra
Duy Nguyen wrote: > Hmm.. I missed that mail (or I wouldn't have worked on this already). > Do you want to take over? Oh, we can collaborate on one beautiful series :) > "branch -vv" shows [upstream: ahead x, behind y]. We need a syntax to > cover that too. Can't we construct that using [%(upstr

Re: [PATCH/WIP 0/9] for-each-ref format improvements

2013-05-19 Thread Duy Nguyen
On Sun, May 19, 2013 at 6:11 PM, Ramkumar Ramachandra wrote: > Nguyễn Thái Ngọc Duy wrote: >> The purpose of this series is to make "for-each-ref --format" powerful >> enough to display what "branch -v" and "branch -vv" do so that we >> could get rid of those display code and use for-each-ref code

Re: [PATCH/WIP 0/9] for-each-ref format improvements

2013-05-19 Thread Felipe Contreras
On Sun, May 19, 2013 at 6:11 AM, Ramkumar Ramachandra wrote: > Yes, I think this is the direction we should be taking. Poorly > thought-out stuff like -v and -vv should be deprecated. Of course not. They are useful and user-friendly. The only question is what should be the format by default.

Re: [PATCH/WIP 0/9] for-each-ref format improvements

2013-05-19 Thread Ramkumar Ramachandra
Nguyễn Thái Ngọc Duy wrote: > The purpose of this series is to make "for-each-ref --format" powerful > enough to display what "branch -v" and "branch -vv" do so that we > could get rid of those display code and use for-each-ref code instead. Damn, you beat me to it. I just introduced color, and w

[PATCH/WIP 0/9] for-each-ref format improvements

2013-05-19 Thread Nguyễn Thái Ngọc Duy
The purpose of this series is to make "for-each-ref --format" powerful enough to display what "branch -v" and "branch -vv" do so that we could get rid of those display code and use for-each-ref code instead. The benefits are clear: share more code, branch can also borrow --sort and --format from f