Re: [PATCH v13] [GSOC] commit: add --trailer option

2 messages, 2 authors, 2021-03-24 · open the first message on its own page

Re: [PATCH v13] [GSOC] commit: add --trailer option

From: Junio C Hamano <hidden>
Date: 2021-03-23 17:13:34

ZheNing Hu [off-list ref] writes:
Junio C Hamano [off-list ref] 于2021年3月23日周二 下午2:19写道:
quoted
Christian Couder [off-list ref] writes:
quoted
If you want nothing to happen when $ARG isn't set, you can change the
config option to something like:

$ git config trailer.sign.command "NAME='\$ARG'; test -n \"\$NAME\" &&
git log --author=\"\$NAME\" -1 --format='format:%aN <%aE>' || true"

(This is because it looks like $ARG is replaced only once with the
actual value, which is perhaps a bug. Otherwise something like the
following might work:
I do not know the origin of that code in trailers.c but it feels
quite confused and error prone to use textual replacement with
strbuf_replace().  Why doesn't the code, which knows it will use
shell to execute the command line given by the end user in the
configuration, to just export ARG as an environment variable and
be done with it?  It would also avoid quoting problem etc.
Maybe like this?
Code is not an important part.  We should think through
ramifications of making (and not making) such a change first.

Re: [PATCH v13] [GSOC] commit: add --trailer option

From: ZheNing Hu <hidden>
Date: 2021-03-24 05:26:16

quoted
Maybe like this?
Code is not an important part.  We should think through
ramifications of making (and not making) such a change first.
Sorry for without careful consideration.
Thank for this valuable suggestion.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help