Re: [PATCH v13 04/12] ref-filter: implement an `align` atom

2015-08-26 Thread Karthik Nayak
On Tue, Aug 25, 2015 at 11:26 PM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: I like the idea of using atomv-handler() a lot, mostly cause this would eventually help us clean up populate_atom() which currently seems like a huge dump of code. I think

Re: [PATCH v13 04/12] ref-filter: implement an `align` atom

2015-08-25 Thread Junio C Hamano
Matthieu Moy matthieu@grenoble-inp.fr writes: Junio C Hamano gits...@pobox.com writes: You can see that I expected that if !state.stack-prev check to be inside append_atom(), and I would imagine future readers would have the same expectation when reading this code. I.e.

Re: [PATCH v13 04/12] ref-filter: implement an `align` atom

2015-08-25 Thread Junio C Hamano
Karthik Nayak karthik@gmail.com writes: I like the idea of using atomv-handler() a lot, mostly cause this would eventually help us clean up populate_atom() which currently seems like a huge dump of code. I think you already said that last time we had this discussion ;-)

Re: [PATCH v13 04/12] ref-filter: implement an `align` atom

2015-08-25 Thread Matthieu Moy
Junio C Hamano gits...@pobox.com writes: You can see that I expected that if !state.stack-prev check to be inside append_atom(), and I would imagine future readers would have the same expectation when reading this code. I.e. append_atom(struct atom_value *v, struct ref_f_s *state)

Re: [PATCH v13 04/12] ref-filter: implement an `align` atom

2015-08-25 Thread Karthik Nayak
On Tue, Aug 25, 2015 at 3:43 AM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: +static void perform_quote_formatting(struct strbuf *s, const char *str, int quote_style); + +static void end_atom_handler(struct atom_value *atomv, struct

Re: [PATCH v13 04/12] ref-filter: implement an `align` atom

2015-08-25 Thread Karthik Nayak
On Tue, Aug 25, 2015 at 12:17 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Junio C Hamano gits...@pobox.com writes: You can see that I expected that if !state.stack-prev check to be inside append_atom(), and I would imagine future readers would have the same expectation when reading

Re: [PATCH v13 04/12] ref-filter: implement an `align` atom

2015-08-25 Thread Karthik Nayak
On Tue, Aug 25, 2015 at 3:45 AM, Junio C Hamano gits...@pobox.com wrote: Junio C Hamano gits...@pobox.com writes: Karthik Nayak karthik@gmail.com writes: +static void end_atom_handler(struct atom_value *atomv, struct ref_formatting_state *state) +{ +struct ref_formatting_stack

Re: [PATCH v13 04/12] ref-filter: implement an `align` atom

2015-08-24 Thread Junio C Hamano
Karthik Nayak karthik@gmail.com writes: +static void perform_quote_formatting(struct strbuf *s, const char *str, int quote_style); + +static void end_atom_handler(struct atom_value *atomv, struct ref_formatting_state *state) +{ + struct ref_formatting_stack *current =

Re: [PATCH v13 04/12] ref-filter: implement an `align` atom

2015-08-24 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Karthik Nayak karthik@gmail.com writes: +static void end_atom_handler(struct atom_value *atomv, struct ref_formatting_state *state) +{ +struct ref_formatting_stack *current = state-stack; +struct strbuf s = STRBUF_INIT; + +if

[PATCH v13 04/12] ref-filter: implement an `align` atom

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