Re: [PATCH 2/2] [GSOC] ref-filter: add %(raw) atom
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 3, 2021, 21:36 UTC
- Message-ID
- <xmqqy2bq4omw.fsf@gitster.g>
- In-Reply-To
- <CAOLTT8QjnFqXHRzAPnJStf4Ra189dZFe9k-Y9COoSCwW47CXiA@mail.gmail.com>
ZheNing Hu <adlternative@gmail.com> writes:
Show 12 quoted lines
> Now I am building %(raw:textconv) and %(raw:filter), the code will be
> very difficult to write:
>
> if (format->quote_style && !strncmp(sp, "raw", 3)
> && ((!arg) || (!strncmp(arg,
> ":textconv", 9)) || (!strncmp(arg, ":filter", 7))))
> return strbuf_addf_ret(err, -1, _("--format=%.*s
> cannot be used with"
> "--python, --shell, --tcl, --perl"),
> (int)(ep-atom), atom);
>
> Is there any good way?The problem you are having sounds like a natural consequence of doing the check at the wrong place in the code, at least to me.