Re: [PATCH v4] [GSOC] commit: add --trailer option
- From
ZheNing Hu <adlternative@gmail.com>
- Date
- Mar 15, 2021, 01:27 UTC
- Message-ID
- <CAOLTT8RNKFC_NzZXGvE4Zz+NmVHCUAn-jZFu-0Nm=7JAS0jBjA@mail.gmail.com>
- In-Reply-To
- <xmqqh7ld2syx.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> 于2021年3月15日周一 上午7:52写道:
Show 15 quoted lines
> IOW this part would become ...
>
> if (trailer_args.nr) {
> strvec_pushl(&run_trailer.args, "interpret-trailers",
> "--in-place", ...);
> strvec_pushv(&run_trailer.args, trailer_args.v);
> run_trailer.git_cmd = 1;
> run_command(&run_trailer);
> }
>
> > + } else
> > + strvec_clear(&run_trailer.args);
>
> ... and there is no need to have "else" that won't need to do
> anything.Yes, but we also should clear "trailer_args" in "else" here, and check the return value of the "run_command()" for clear "run_trailer.args".
Show 7 quoted lines
> > > verbose = -1; /* unspecified */ > > + strvec_pushl(&run_trailer.args, "interpret-trailers", > > + "--in-place", "--where=end", git_path_commit_editmsg(), NULL); > > And this line will be gone. >
Indeed so.
Thanks.