git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] [GSOC] cherry-pick: fix bug when used with GIT_CHERRY_PICK_HELP

From
ZheNing Hu <adlternative@gmail.com>
Date
Aug 2, 2021, 13:34 UTC
Message-ID
<CAOLTT8S=v41p_uZQ4u0LBnHkRp3pMpVK0Pt5mykzbfX9ReTC7g@mail.gmail.com>
In-Reply-To
<273d1864-422e-f31f-13ef-20cfe4871947@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> 于2021年8月1日周日 下午6:10写道:
Show 22 quoted lines
>
> > diff --git a/builtin/rebase.c b/builtin/rebase.c
> > index 12f093121d9..5983f37d531 100644
> > --- a/builtin/rebase.c
> > +++ b/builtin/rebase.c
> > @@ -84,6 +84,7 @@ struct rebase_options {
> >               REBASE_FORCE = 1<<3,
> >               REBASE_INTERACTIVE_EXPLICIT = 1<<4,
> >       } flags;
> > +     int delete_cherry_pick_head;
> >       struct strvec git_am_opts;
> >       const char *action;
> >       int signoff;
> > @@ -152,6 +153,7 @@ static struct replay_opts get_replay_opts(const struct rebase_options *opts)
> >               oidcpy(&replay.squash_onto, opts->squash_onto);
> >               replay.have_squash_onto = 1;
> >       }
> > +     replay.delete_cherry_pick_head = opts->delete_cherry_pick_head;
>
> I think we could just have
>         replay.delete_cherry_pick_head = 1;
> and not add a new member to rebase_options as we always want this set
Maybe you are right.
Show 25 quoted lines
> > -static void print_advice(struct repository *r, int show_hint,
> > -                      struct replay_opts *opts)
> > +static void print_advice(struct replay_opts *opts, int show_hint)
> >   {
> >       char *msg = getenv("GIT_CHERRY_PICK_HELP");
> >
> >       if (msg) {
> > -             fprintf(stderr, "%s\n", msg);
> > -             /*
> > -              * A conflict has occurred but the porcelain
> > -              * (typically rebase --interactive) wants to take care
> > -              * of the commit itself so remove CHERRY_PICK_HEAD
> > -              */
> > -             refs_delete_ref(get_main_ref_store(r), "", "CHERRY_PICK_HEAD",
> > -                             NULL, 0);
> > -             return;
> > -     }
> > -
> > -     if (show_hint) {
> > +             advise("%s\n", msg);
>
> This is a change in behavior as the advice will now be prefixed with
> "hint: ". I think that is probably an improvement so long as it does not
> make the lines too long when the advice is printed.
>
Yeah, maybe I should mention this in commit messages.
Show 5 quoted lines
>
> I think it would be useful to add a test for the new cherry-pick option
> that is added in this patch. Overall this patch is looking pretty good
> it just needs a few small changes, thanks for working on it.
>
Make sence.
> Best Wishes
>
> Phillip

Thanks. -- ZheNing Hu

Previous: Phillip WoodNext: ZheNing Hu via GitGitGadget
Message 7 of 32 in “[GSOC] cherry-pick: fix bug when used with GIT_CHERRY_PICK_HELP”
  1. 0/2 [GSOC] cherry-pick: fix bug when used with GIT_CHERRY_PICK_HELPZheNing Hu via GitGitGadget, Jul 31, 2021
  2. 2/2 [GSOC] cherry-pick: use better advice messageZheNing Hu via GitGitGadget, Jul 31, 2021
  3. Phillip WoodAug 1, 2021
  4. ZheNing HuAug 2, 2021
  5. 1/2 [GSOC] cherry-pick: fix bug when used with GIT_CHERRY_PICK_HELPZheNing Hu via GitGitGadget, Jul 31, 2021
  6. Phillip WoodAug 1, 2021
  7. ZheNing HuAug 2, 2021
  8. 0/2 [GSOC] cherry-pick: fix bug when used with GIT_CHERRY_PICK_HELPZheNing Hu via GitGitGadget, Aug 3, 2021
  9. 1/2 [GSOC] cherry-pick: fix bug when used with GIT_CHERRY_PICK_HELPZheNing Hu via GitGitGadget, Aug 3, 2021
  10. Junio C HamanoAug 3, 2021
  11. ZheNing HuAug 4, 2021
  12. Phillip WoodAug 4, 2021
  13. Junio C HamanoAug 4, 2021
  14. ZheNing HuAug 5, 2021
  15. 2/2 [GSOC] cherry-pick: use better advice messageZheNing Hu via GitGitGadget, Aug 3, 2021
  16. [GSOC] cherry-pick: use better advice messageZheNing Hu via GitGitGadget, Aug 5, 2021
  17. Phillip WoodAug 11, 2021
  18. ZheNing HuAug 13, 2021
  19. Junio C HamanoAug 13, 2021
  20. ZheNing HuAug 14, 2021
  21. Phillip WoodAug 17, 2021
  22. [GSOC] cherry-pick: use better advice messageZheNing Hu via GitGitGadget, Aug 14, 2021
  23. Junio C HamanoAug 14, 2021
  24. ZheNing HuAug 15, 2021
  25. [GSOC] cherry-pick: use better advice messageZheNing Hu via GitGitGadget, Aug 16, 2021
  26. Phillip WoodAug 18, 2021
  27. ZheNing HuAug 19, 2021
  28. ZheNing HuAug 19, 2021
  29. [GSOC] cherry-pick: use better advice messageZheNing Hu via GitGitGadget, Aug 19, 2021
  30. Junio C HamanoAug 19, 2021
  31. ZheNing HuAug 21, 2021
  32. [GSOC] cherry-pick: use better advice messageZheNing Hu via GitGitGadget, Aug 22, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.