Re: [PATCH 8/9] branch: use ref-filter printing APIs

2015-10-07 Thread Karthik Nayak
On Wed, Oct 7, 2015 at 11:28 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> On Wed, Oct 7, 2015 at 12:33 AM, Matthieu Moy >> wrote: >> >>> To go a bit further, you can pre-build a string or strbuf aligned_short >>> with value like "%%(align:20,left)%%(refname:short)%%(end)" and use it >>>

Re: [PATCH 8/9] branch: use ref-filter printing APIs

2015-10-07 Thread Matthieu Moy
Karthik Nayak writes: > On Wed, Oct 7, 2015 at 12:33 AM, Matthieu Moy > wrote: > >> To go a bit further, you can pre-build a string or strbuf aligned_short >> with value like "%%(align:20,left)%%(refname:short)%%(end)" and use it >> where needed (it's not a constant because you have to introduce

Re: [PATCH 8/9] branch: use ref-filter printing APIs

2015-10-07 Thread Karthik Nayak
On Wed, Oct 7, 2015 at 12:33 AM, Matthieu Moy wrote: > Karthik Nayak writes: > >> If you look closely, thats only for the local branches, the remotes >> have `align` atom when >> printing in verbose. > > Yes, but that's already one thing factored out of the if, even if it's > just for local. > >

Re: [PATCH 8/9] branch: use ref-filter printing APIs

2015-10-06 Thread Matthieu Moy
Karthik Nayak writes: > If you look closely, thats only for the local branches, the remotes > have `align` atom when > printing in verbose. Yes, but that's already one thing factored out of the if, even if it's just for local. Actually, I think you can also factor some parts out of the %(if:not

Re: [PATCH 8/9] branch: use ref-filter printing APIs

2015-10-06 Thread Karthik Nayak
On Tue, Oct 6, 2015 at 12:13 AM, Matthieu Moy wrote: > Karthik Nayak writes: > >> On Sat, Oct 3, 2015 at 6:11 PM, Matthieu Moy >> wrote: >>> Actually, this is not a performance-cricical piece of code at all, so I >>> think it's even better to build an strbuf little by little using >>> repeated s

Re: [PATCH 8/9] branch: use ref-filter printing APIs

2015-10-05 Thread Matthieu Moy
Karthik Nayak writes: > On Sat, Oct 3, 2015 at 6:11 PM, Matthieu Moy > wrote: >> Actually, this is not a performance-cricical piece of code at all, so I >> think it's even better to build an strbuf little by little using >> repeated strbuf_addf calls. This way you can do things like >> >> strbuf

Re: [PATCH 8/9] branch: use ref-filter printing APIs

2015-10-05 Thread Karthik Nayak
On Sat, Oct 3, 2015 at 6:11 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> - if (upstream_is_gone) { >> - if (show_upstream_ref) >> - strbuf_addf(stat, _("[%s: gone]"), fancy.buf); > > The old string was translated, and you're replacing it with one which

Re: [PATCH 8/9] branch: use ref-filter printing APIs

2015-10-03 Thread Matthieu Moy
Karthik Nayak writes: > - if (upstream_is_gone) { > - if (show_upstream_ref) > - strbuf_addf(stat, _("[%s: gone]"), fancy.buf); The old string was translated, and you're replacing it with one which isn't. I'm not a big fan of translation, so that change doesn

[PATCH 8/9] branch: use ref-filter printing APIs

2015-10-02 Thread Karthik Nayak
Port branch.c to use ref-filter APIs for printing. This clears out most of the code used in branch.c for printing and replaces them with calls made to the ref-filter library. Introduce get_format() which gets the format required for printing of refs. Make amendments to print_ref_list() to reflect