Thread (3 messages) flat view 3 messages, 2 authors, 2021-06-03

Re: [PATCH 2/2] [GSOC] ref-filter: add %(raw) atom

From: ZheNing Hu <hidden>
Date: 2021-06-03 14:07:59

ZheNing Hu [off-list ref] 于2021年6月3日周四 下午1:36写道:
Junio C Hamano [off-list ref] 于2021年6月3日周四 上午10:38写道:
quoted
But I do not think we want to add the new change at this location,
at least for two reasons:

 * The posted patch checks '!arg' to avoid rejecting "raw:size",
   which would not scale at all.  What if you wanted to later add
   "raw:upcase", which you must reject?
Yeah, the code here makes "raw" lack of scalability. Especially we
want to add "%(raw:textconv)" and "%(raw:filter)" later.
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?

Thanks.
--
ZheNing Hu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help