Re: [PATCH v2 0/3] Towards a useable git-branch
From: Duy Nguyen <hidden>
Date: 2016-06-15 22:57:33
On Tue, Jun 4, 2013 at 7:52 PM, Ramkumar Ramachandra [off-list ref] wrote:
Duy Nguyen wrote:quoted
Nobody should ever parse these output with scripts. The color can be generated from color.branch.*.How do we implement color.branch.(current|local|remote|plain)? In the current code, we take a crude approach by hand-constructing argc, argv strings and passing it to cmd_for_each_ref(). There are no conditionals in the format syntax (and introducing one is probably not a good idea either): so, I'm guessing these configuration variables have to be read by for-each-ref?
Maybe. I don't really like the idea that for-each-ref reads _branch_ config. We could introduce the same set of keys but in color.for-each-ref namespace. %C(auto) will take care of the logic and choose the correct color key. When we replace branch's listing code with for-each-ref, I think we could somehow override for-each-ref keys with branch ones in-core. Too hacky?
quoted
A bigger problem is show_detached(), --[no-]merged, --with and --contains. We need to move some of those code over to for-each-ref.I saw that you fixed this.
Nope. --[no-]merged and --contains seem easy. show_detached is still WIP, mostly because detached HEAD may or may not show when you provide a pattern to git-branch (e.g. git branch --list 'foo*') and because HEAD is always the first item, regardless of sorting order. get_head_description also seems more porcelain-ish than a plumbing feature..
quoted
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.Does your track-responsiveness patch fix this?
Yes.
quoted
I checked out your branch, made some more updates and pushed out to my for-each-ref-pretty again. Changes are:*pants* Sorry, I'm finding it hard to keep up.
Sorry that branch was in a better shape the day I sent my previous email. Then I kind of used it as a playground with --[no-]merged, --contains and stuff :-P -- Duy