Re: [PATCH v2] [GSOC] cherry-pick: fix bug when used with GIT_CHERRY_PICK_HELP
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jul 28, 2021, 16:52 UTC
- Message-ID
- <3627fd65-54bc-2dd0-85fc-93ced57fc7ac@gmail.com>
- In-Reply-To
- <CAOLTT8T-NYEyxabCbSuLkXVKf15LMqf75a0gSR0aGCmeC8dSZw@mail.gmail.com>
On 28/07/2021 12:01, ZheNing Hu wrote:
Show 20 quoted lines
> Phillip Wood <phillip.wood123@gmail.com> 于2021年7月28日周三 下午5:46写道: >> >> Hi ZheNing >> >>> Ah, because I want to find a way to suppress its advice messages about >>> "git commit", >>> and I don’t think anyone else is using this "feature". >> >> I'd welcome a patch to improve the advice. I suspect the current advice >> predates the introduction of the '--continue' flag for cherry-pick. I >> think that would be a better route forward as it would benefit all >> users. Setting GIT_CHERRY_PICK_HELP is undocumented and has always >> removed CHERRY_PICK_HEAD since CHERRY_PICK_HEAD was introduced in commit >> 7e5c0cbf (Introduce CHERRY_PICK_HEAD, 2011-02-19). >> > > After I modify the interface of print_advice() in the way suggested by > Junio, I can provide a > help_msg parameter for print_advice(), and maybe we can use it to > provide better advice later.
I think that we could change the advice now to suggest using 'git cherry-pick --continue' instead of running 'git commit'. I think that in the long term we want to move away from being able to customize the advice when 'git rebase -p' is retired.
Best Wishes
Phillip
Show 26 quoted lines
> Something like this:
>
> +static void print_advice(struct replay_opts *opts, const char *help_msgs)
> +{
> + if (help_msgs)
> + fprintf(stderr, "%s\n", help_msgs);
> + else if (opts->no_commit)
> + advise(_("after resolving the conflicts, mark the
> corrected paths\n"
> + "with 'git add <paths>' or 'git rm <paths>'"));
> + else
> + advise(_("after resolving the conflicts, mark the
> corrected paths\n"
> + "with 'git add <paths>' or 'git rm <paths>'\n"
> + "and commit the result with 'git commit'"));
> }
>
>> Best Wishes
>>
>> Phillip
>>
>
> Thanks.
> --
> ZheNing Hu
>