Re: [PATCH v5] [GSOC] commit: add --trailer option
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Mar 15, 2021, 05:41 UTC
- Message-ID
- <CAP8UFD2tz-apz+C8+Q+P4-8zZOq7zDsupkX31EHyT0msH3eX0A@mail.gmail.com>
- In-Reply-To
- <CAP8UFD3mpu6eTqifnwUV4uHoAASaQnxX21CacOn4dGSp+juVKw@mail.gmail.com>
On Mon, Mar 15, 2021 at 6:33 AM Christian Couder <christian.couder@gmail.com> wrote:
Show 19 quoted lines
>
> On Mon, Mar 15, 2021 at 4:24 AM ZheNing Hu via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
>
> > diff --git a/builtin/commit.c b/builtin/commit.c
> > index 739110c5a7f6..24fccb561398 100644
> > --- a/builtin/commit.c
> > +++ b/builtin/commit.c
> > @@ -113,6 +113,9 @@ 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;
>
> It seems to me that `run_trailer` is used only in the `if
> (trailer_args.nr) {...}` block, so it could be declared there instead
> of as a global variable.
>
> > +struct strvec trailer_args = STRVEC_INIT;Also you might want to add "static" in front of "struct strvec" in the above line.