git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karthik Nayak <karthik.188@gmail.com>
To: Matthieu Moy <matthieu.moy@imag.fr>
Cc: Eric Sunshine <sunshine@sunshineco.com>,
	Git List <git@vger.kernel.org>,
	Christian Couder <christian.couder@gmail.com>,
	Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v9 03/11] ref-filter: implement an `align` atom
Date: Sun, 9 Aug 2015 13:40:16 +0530	[thread overview]
Message-ID: <CAOLa=ZS4GKkzMZvSRiK6FdL1OjJ=MdKkQt7Mxb2sT0-LPX9V-A@mail.gmail.com> (raw)
In-Reply-To: <368C34E3-F245-45AD-847B-0866C61295DA@imag.fr>

On Sun, Aug 9, 2015 at 1:30 PM, Matthieu Moy <matthieu.moy@imag.fr> wrote:
>
>
> Le 8 août 2015 09:03:03 GMT+02:00, Karthik Nayak <karthik.188@gmail.com> a écrit :
>>On Fri, Aug 7, 2015 at 9:34 AM, Eric Sunshine <sunshine@sunshineco.com>
>>wrote:
>>> On Wed, Aug 5, 2015 at 2:54 PM, Karthik Nayak <karthik.188@gmail.com>
>>wrote:
>>>> Implement an `align` atom which will act as a modifier atom and
>>align
>>>> any string with or without an %(atom) appearing before a %(end) atom
>>>> to the right, left or middle.
>>>>
>>>> It is followed by `:<type>,<paddinglength>`, where the `<type>` is
>>>> either left, right or middle and `<paddinglength>` is the total
>>length
>>>> of the padding to be performed. If the atom length is more than the
>>>> padding length then no padding is performed. e.g. to pad a
>>succeeding
>>>> atom to the middle with a total padding size of 40 we can do a
>>>> --format="%(align:middle,40).."
>>>>
>>>> Add documentation and tests for the same.
>>>
>>> I forgot to mention in my earlier review of this patch that you
>>should
>>> explain in the commit message, and probably the documentation, this
>>> this implementation (assuming I'm understanding the code) does not
>>> correctly support nested %(foo)...%(end) constructs, where %(foo)
>>> might be %(if:), %(truncate:), %(cut:), or even a nested %(align:),
>>or
>>> some as yet unimagined modifier. Supporting nesting of these
>>> constructs will require pushing the formatting states onto a stack
>>(or
>>> invoking the parser recursively).
>>>
>>>> Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
>>
>>Good point, I have been working on this parallely and it works for now,
>>I'll send that with the %(if) and %(end) feature. But for now, it
>>should be
>>documented and added in the commit message.
>>
>>Using a linked list of sorts where whenever a new modifier atom is
>>encountered
>>a new state is created, and once %(end) is encountered we can pop that
>>state
>>into the previous state.
>
> Good, but keep in mind that this is not needed to port tag/branch, and your GSoC end soon. So keep your priorities in mind... IMHO, the nestable implementation can wait.
>
> Cheers,
>

Agreed, but it was just something I had already worked on. Probably
will push that series after GSoC :)


-- 
Regards,
Karthik Nayak

  reply	other threads:[~2015-08-09  8:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAOLa=ZRnnMBKpsq1ANBVgF2=xwK=A2EsPKKrGS0R4mZ8iATKfA@mail.gmail.com>
2015-08-05 18:54 ` [PATCH v9 03/11] ref-filter: implement an `align` atom Karthik Nayak
2015-08-07  3:27   ` Eric Sunshine
2015-08-08  6:35     ` Karthik Nayak
2015-08-09  3:42       ` Eric Sunshine
2015-08-09  6:55         ` Karthik Nayak
2015-08-09  8:04           ` Eric Sunshine
2015-08-09  8:09             ` Karthik Nayak
2015-08-09  8:19               ` Eric Sunshine
2015-08-09 12:54                 ` Karthik Nayak
2015-08-07  4:04   ` Eric Sunshine
2015-08-08  7:03     ` Karthik Nayak
2015-08-09  8:00       ` Matthieu Moy
2015-08-09  8:10         ` Karthik Nayak [this message]
2015-08-04 12:39 [PATCH v9 0/11] Port tag.c over to use ref-filter APIs Karthik Nayak
2015-08-04 12:42 ` [PATCH v9 01/11] ref-filter: print output to strbuf for formatting Karthik Nayak
2015-08-04 12:43   ` [PATCH v9 03/11] ref-filter: implement an `align` atom Karthik Nayak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOLa=ZS4GKkzMZvSRiK6FdL1OjJ=MdKkQt7Mxb2sT0-LPX9V-A@mail.gmail.com' \
    --to=karthik.188@gmail.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=matthieu.moy@imag.fr \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).