Re: [PATCH v12 03/13] ref-filter: introduce the ref_formatting_state stack machinery

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matthieu Moy <Matthieu.Moy@xxxxxxxxxxxxxxx> writes:

> Junio C Hamano <gitster@xxxxxxxxx> writes:
>
>> So I think 'quote' should apply only to the top-level atoms in the
>> nested %(magic)...%(end) world.
>
> This is true in most cases, but I think there would also be use-cases
> where you would want the opposite, like:
>
> --format '
>     %(if:whatever)
>     echo %(refname)
>     %(end)
> '
>
> I'm not sure what's best, but if both can make sense, perhaps we should
> just keep the simplest to implement, i.e. the current behavior.

I am reasonably sure what's best, as --{shell,tcl,...} with --format
is my invention ;-)

The whole point of these "language specific quotes" to have
"--format" output to be an executable script is so that the user can
express control in that scripting language.  We must be able process
the examples in the message you are responding to, i.e. allowing
%(atom) and %(magic)...%(end) correctly assigned to a variable of
the target language.  If that implementation happens to also grok
your "%(if:whatever)...%(then)echo %(refname)%(end)" example in a
way you expect, that would be great, but if not, then I do not think
it is worth worrying about it.  On the other hand, a solution that
does not solve the primary use case is worthless, even if it is
simple to implement.

I do not think we deeply mind if we forbid use if %(if)...%(end)
when quoting is in use, if the current implementation too broken
beyond salvaging.  I however think that %(align:40)%(atom)%(end)
would want to be usable even with quoting, and I suspect that an
implementation that groks %(align) correctly would automatically
grok %(if), too.

So...




--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]