On Tue, May 28, 2013 at 9:24 PM, Ramkumar Ramachandra <artagnon@xxxxxxxxx> wrote: > Oh, and by the way: > > We're pretty close we are to replacing branch -v and branch -vv. > > brv = for-each-ref --format='%(HEAD) > %C(green)%<(*)%(refname:short)%C(reset) %<(*)%(objectname:short) > %(subject)' refs/heads > > brvv = for-each-ref --format='%(HEAD) > %C(green)%<(*)%(refname:short)%C(reset) %<(*)%(objectname:short) > %C(blue)%(upstream:short)%C(reset) %(subject)' refs/heads > > There are small differences: > > 1. In branch -v, the green-color of the branch name is dependent on > %(HEAD). Not worth ironing out, in my opinion. > > 2. In branch -vv, there are dependent square braces that come on when > %(refname:short) is set. We might want to introduce an undocumented > %(refname:branchvv) for internal use by branch -vv, for backward > compatibility. > > What do you think? I think we can change -v and -vv format slightly as long as the information remains the same. Nobody should ever parse these output with scripts. The color can be generated from color.branch.*. A bigger problem is show_detached(), --[no-]merged, --with and --contains. We need to move some of those code over to for-each-ref. Another problem is the new "branch -v" seems to less responsive than old "branch -v" because (I think) of sorting, even if we don't need it. I checked out your branch, made some more updates and pushed out to my for-each-ref-pretty again. Changes are: - fix segfault with "for-each-ref --format=%something refs/tags/' - add --pretty for new format syntax and keep --format unchanged - add --[no-]column to for-each-ref (for "git branch" with no arguments) - remove branch listing code and use for-each-ref instead (41 inserts, 378 deletes, beautiful). - add --sort and --count to git-branch -- Duy -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html