Re: [PATCH v9 01/20] ref-filter: implement %(if), %(then), and %(else) atoms
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Dec 28, 2016, 06:47 UTC
- Message-ID
- <CAOLa=ZRbpMhFx_QGPeT9oBpKLq7FZ-fDXt=ueY0TDn6y_-4dfg@mail.gmail.com>
- In-Reply-To
- <xmqqbmvx842i.fsf@gitster.mtv.corp.google.com>
On Wed, Dec 28, 2016 at 2:28 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 16 quoted lines
> Karthik Nayak <karthik.188@gmail.com> writes: > >> >> +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, 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. > > What is unsaid in the last paragraph is that you assume "is > evaluated according to the semantics of the opening atom" does not > involve quoting and only the result from the top-level is quoted. I > am not sure if that is clear to the first-time readers. >
How about being a little more explicit about that?
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 only its result from the top-level is quoted.
Show 14 quoted lines
>> >> EXAMPLES >> -------- >> @@ -273,6 +291,22 @@ eval=`git for-each-ref --shell --format="$fmt" \ >> eval "$eval" >> ------------ >> ... >> +------------ >> +git for-each-ref --format="%(refname)%(if)%(authorname)%(then) %(color:red)Authored by: %(authorname)%(end)" >> +------------ > > This makes readers wonder how "red"ness is reset, but that is not > something this example is interested in demonstrating. Let's drop > the %(color:red) bit to avoid distracting readers.
Sure, will do :)
-- Regards, Karthik Nayak