Re: [PATCH v7 01/17] ref-filter: implement %(if), %(then), and %(else) atoms
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Nov 10, 2016, 17:11 UTC
- Message-ID
- <CAOLa=ZS_V5SNSbiC_sT6E9rJMbxCMm=BRaoPL44xBNXAG2pgbA@mail.gmail.com>
- In-Reply-To
- <CA+P7+xoAmYqi0OazZux+rooXW+D_N9L5s+2BzUyJJJXtmLZX-Q@mail.gmail.com>
Hey,
On Wed, Nov 9, 2016 at 4:43 AM, Jacob Keller <jacob.keller@gmail.com> wrote:
Show 21 quoted lines
> On Tue, Nov 8, 2016 at 12:11 PM, Karthik Nayak <karthik.188@gmail.com> wrote: >> From: Karthik Nayak <karthik.188@gmail.com> >> >> +Some atoms like %(align) and %(if) always require a matching %(end). >> +We call them "opening atoms" and sometimes denote them as %($open). >> + >> +When a scripting language specific quoting is in effect (i.e. one of >> +`--shell`, `--perl`, `--python`, `--tcl` is used), except for opening >> +atoms, replacement from every %(atom) is quoted when and only when it >> +appears at the top-level (that is, when it appears outside >> +%($open)...%(end)). >> + >> +When a scripting language specific quoting is in effect, everything >> +between a top-level opening atom and its matching %(end) is evaluated >> +according to the semantics of the opening atom and its result is >> +quoted. >> + >> > > Nice, I like the explanation above. >
All thanks to Eric, Junio, Christian, Matthieu and everyone else who helped me phrase these.
Show 15 quoted lines
>>
>> + }
>> + } else if (!if_then_else->condition_satisfied)
>
> Minor nit. I'm not sure what standard we use here at Git, but
> traditionally, I prefer to see { } blocks on all sections even if only
> one of them needs it. (That is, only drop the braces when every
> section is one line.) It also looks weird with a comment since it
> appears as multiple lines to the reader. I think the braces improve
> readability.
>
> I don't know whether that's Git's code base standard or not, however.
> It's not really worth a re-roll unless something else would need to
> change.
>I believe this is the syntax followed in Git, xdiff/xmerge.c:173 and so on.
You're comments are right on though.
-- Regards, Karthik Nayak