Re: [PATCH v7 01/17] ref-filter: implement %(if), %(then), and %(else) atoms
From: Karthik Nayak <hidden>
Date: 2016-11-10 17:12:23
Hey, On Wed, Nov 9, 2016 at 4:43 AM, Jacob Keller [off-list ref] wrote:
On Tue, Nov 8, 2016 at 12:11 PM, Karthik Nayak [off-list ref] wrote:quoted
From: Karthik Nayak <redacted> +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.
quoted
+ } + } 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