Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-04 Thread Karthik Nayak
On Thu, Sep 3, 2015 at 9:53 PM, Junio C Hamano wrote: > Eric Sunshine writes: > >> On Tue, Sep 1, 2015 at 2:26 PM, Karthik Nayak wrote: >>> Implement an `align` atom which left-, middle-, or right-aligns the >>> content between %(align:..) and %(end). >> >> Spell this either %(align:) or %(align

Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-03 Thread Junio C Hamano
Eric Sunshine writes: > On Tue, Sep 1, 2015 at 2:26 PM, Karthik Nayak wrote: >> Implement an `align` atom which left-, middle-, or right-aligns the >> content between %(align:..) and %(end). > > Spell this either %(align:) or %(align:...) with three dots, not two. > I, personally, think %(align:

Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-03 Thread Karthik Nayak
On Thu, Sep 3, 2015 at 7:42 PM, Eric Sunshine wrote: > On Tue, Sep 1, 2015 at 2:26 PM, Karthik Nayak wrote: >> Implement an `align` atom which left-, middle-, or right-aligns the >> content between %(align:..) and %(end). > > Spell this either %(align:) or %(align:...) with three dots, not two. >

Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-03 Thread Eric Sunshine
On Tue, Sep 1, 2015 at 2:26 PM, Karthik Nayak wrote: > Implement an `align` atom which left-, middle-, or right-aligns the > content between %(align:..) and %(end). Spell this either %(align:) or %(align:...) with three dots, not two. I, personally, think %(align:) is sufficient. > It is followe

Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-03 Thread Karthik Nayak
On Wed, Sep 2, 2015 at 10:58 PM, Junio C Hamano wrote: > Matthieu Moy writes: > >> Junio C Hamano writes: >> >>> Karthik Nayak writes: >>> On Wed, Sep 2, 2015 at 8:31 PM, Junio C Hamano wrote: > Karthik Nayak writes: > + die(_("format: `end` atom used without

Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-02 Thread Junio C Hamano
Matthieu Moy writes: > Junio C Hamano writes: > >> Karthik Nayak writes: >> >>> On Wed, Sep 2, 2015 at 8:31 PM, Junio C Hamano wrote: Karthik Nayak writes: >>> + die(_("format: `end` atom used without a supporting >>> atom")); >> >> Not a show-stopper, b

Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-02 Thread Matthieu Moy
Junio C Hamano writes: > Karthik Nayak writes: > >> On Wed, Sep 2, 2015 at 8:31 PM, Junio C Hamano wrote: >>> Karthik Nayak writes: >>> >> + die(_("format: `end` atom used without a supporting >> atom")); > > Not a show-stopper, but we may need some wordsmithing fo

Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-02 Thread Karthik Nayak
On Wed, Sep 2, 2015 at 9:15 PM, Junio C Hamano wrote: > Karthik Nayak writes: > >> On Wed, Sep 2, 2015 at 8:31 PM, Junio C Hamano wrote: >>> Karthik Nayak writes: >>> >> + die(_("format: `end` atom used without a supporting >> atom")); > > Not a show-stopper, but we

Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-02 Thread Matthieu Moy
Karthik Nayak writes: > On Wed, Sep 2, 2015 at 2:15 PM, Matthieu Moy >>> @@ -754,6 +816,42 @@ static void populate_value(struct ref_array_item *ref) >>> else >>> v->s = " "; >>> continue; >>> + } else if (skip_p

Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-02 Thread Matthieu Moy
Junio C Hamano writes: > Karthik Nayak writes: > + } else if (skip_prefix(name, "align", &valp)) { >>> >>> This looked as if you are willing to take %(align) in addition to >>> %(align:...), but... >>> + struct align *align = &v->align; +

Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-02 Thread Junio C Hamano
Karthik Nayak writes: > On Wed, Sep 2, 2015 at 8:31 PM, Junio C Hamano wrote: >> Karthik Nayak writes: >> > + die(_("format: `end` atom used without a supporting atom")); Not a show-stopper, but we may need some wordsmithing for "a supporting atom" here; an end-us

Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-02 Thread Karthik Nayak
On Wed, Sep 2, 2015 at 8:31 PM, Junio C Hamano wrote: > Karthik Nayak writes: > + die(_("format: `end` atom used without a supporting atom")); >>> >>> Not a show-stopper, but we may need some wordsmithing for "a >>> supporting atom" here; an end-user would not know what it is. >>

Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-02 Thread Junio C Hamano
Karthik Nayak writes: >>> + die(_("format: `end` atom used without a supporting atom")); >> >> Not a show-stopper, but we may need some wordsmithing for "a >> supporting atom" here; an end-user would not know what it is. > > Probably something like "format: `end` atom should only be >

Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-02 Thread Karthik Nayak
On Wed, Sep 2, 2015 at 2:15 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> --- a/ref-filter.c >> +++ b/ref-filter.c > >> @@ -163,9 +174,28 @@ static void quote_formatting(struct strbuf *s, const >> char *str, int quote_style) >> } >> } >> >> +static void align_handler(struct ref_for

Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-02 Thread Karthik Nayak
On Wed, Sep 2, 2015 at 2:11 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> +test_expect_success 'alignment with format quote' ' >> + cat >expect <<-EOF && >> + refname is ${sq} ${sq}\\${sq}${sq}master${sq}\\${sq}${sq} >>${sq}| >> + refname is ${sq}

Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-02 Thread Karthik Nayak
On Wed, Sep 2, 2015 at 2:49 AM, Junio C Hamano wrote: > Karthik Nayak writes: > >> We have an `at_end` function for each element of the stack which is to >> be called when the `end` atom is encountered. Using this we implement >> the aling_handler() for the `align` atom, this aligns the final str

Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-02 Thread Matthieu Moy
Karthik Nayak writes: > --- a/ref-filter.c > +++ b/ref-filter.c > @@ -163,9 +174,28 @@ static void quote_formatting(struct strbuf *s, const > char *str, int quote_style) > } > } > > +static void align_handler(struct ref_formatting_stack *stack) Perhaps name it end_align_handler, to ma

Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-02 Thread Matthieu Moy
Karthik Nayak writes: > +test_expect_success 'alignment with format quote' ' > + cat >expect <<-EOF && > + refname is ${sq} ${sq}\\${sq}${sq}master${sq}\\${sq}${sq} > ${sq}| > + refname is ${sq}${sq}\\${sq}${sq}side${sq}\\${sq}${sq} > ${sq}

Re: [PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-01 Thread Junio C Hamano
Karthik Nayak writes: > We have an `at_end` function for each element of the stack which is to > be called when the `end` atom is encountered. Using this we implement > the aling_handler() for the `align` atom, this aligns the final strbuf align_handler(). > struct ref_formatting_stack { >

[PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-01 Thread Karthik Nayak
Implement an `align` atom which left-, middle-, or right-aligns the content between %(align:..) and %(end). It is followed by `:,`, where the `` is either left, right or middle and `` is the size of the area into which the content will be placed. If the content between %(align:) and %(end) is more