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

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

 



On Mon, Mar 15, 2021 at 7:35 AM ZheNing Hu via GitGitGadget
<gitgitgadget@xxxxxxxxx> wrote:
>
> From: ZheNing Hu <adlternative@xxxxxxxxx>
>
> Historically, Git has supported the 'Signed-off-by' commit trailer
> using the '--signoff' and the '-s' option from the command line.
> But users may need to provide other trailer information from the
> command line such as "Helped-by", "Reported-by", "Mentored-by",
>
> Now implement a new `--trailer <token>[(=|:)<value>]` option to pass
> other trailers to `interpret-trailers` and insert them into commit
> messages.
>
> Signed-off-by: ZheNing Hu <adlternative@xxxxxxxxx>
> ---
>     [GSOC] commit: add --trailer option
>
>     Now maintainers or developers can also use commit
>     --trailer="Signed-off-by:commiter<email>" from the command line to
>     provide trailers to commit messages. This solution may be more
>     generalized than v1.
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-901%2Fadlternative%2Fcommit-with-multiple-signatures-v6
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-901/adlternative/commit-with-multiple-signatures-v6
> Pull-Request: https://github.com/gitgitgadget/git/pull/901
>
> Range-diff vs v5:
>
>  1:  ca91accb2852 ! 1:  c99ce75da792 [GSOC] commit: add --trailer option
>      @@ builtin/commit.c: static int config_commit_verbose = -1; /* unspecified */
>        static int no_post_rewrite, allow_empty_message, pathspec_file_nul;
>        static char *untracked_files_arg, *force_date, *ignore_submodule_arg, *ignored_arg;
>        static char *sign_commit, *pathspec_from_file;
>      -+struct child_process run_trailer = CHILD_PROCESS_INIT;
>       +struct strvec trailer_args = STRVEC_INIT;

I suggested added "static" in front of the above line, like this:

static struct strvec trailer_args = STRVEC_INIT;

You can check with `git grep '^static struct strvec' '*.c'` and `git
grep '^struct strvec' '*.c'` that we use "static" when declaring a
'struct strvec' globally.

[...]

>       + if (trailer_args.nr) {
>      ++         static struct child_process run_trailer = CHILD_PROCESS_INIT;

I didn't suggest using "static" here.

>      ++
>       +         strvec_pushl(&run_trailer.args, "interpret-trailers",

Thanks for working on this!



[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]

  Powered by Linux