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

Re: [PATCH v2] [GSOC] cherry-pick: fix bug when used with GIT_CHERRY_PICK_HELP

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 28, 2021, 17:24 UTC
Message-ID
<xmqqr1fi9wsj.fsf@gitster.g>
In-Reply-To
<CAOLTT8RRbwss5sJAM-a=LQrZjr0fyOP4C_x8oRGdLFFnpc+M3g@mail.gmail.com>
ZheNing Hu <adlternative@gmail.com> writes:
Show 15 quoted lines
> I think this function "check_need_delete_cherry_pick_head()" should be before
> print_advice(), like this:
>
> +               const char *help_msgs = NULL;
> +
>                 error(command == TODO_REVERT
>                       ? _("could not revert %s... %s")
>                       : _("could not apply %s... %s"),
>                       short_commit_name(commit), msg.subject);
> -               print_advice(r, res == 1, opts);
> +               if (((opts->action == REPLAY_PICK &&
> +                     !opts->rebase_preserve_merges_mode) ||
> +                     (help_msgs = check_need_delete_cherry_pick_head(r))) &&
> +                     res == 1)
> +                       print_advice(opts, help_msgs);

Sorry, but I am not sure what problem this separation is trying to solve.

The root cause of the issue we have, I think, is because the decision to delete or keep the cherry-pick-head pseudoref is tied to what message we give to users in the current code, and the suggested split of concern is to limit print_advice() to only print the advice message, and a new helper to decide and remove the pseudoref, without relying on what is in the GIT_CHERRY_PICK_HELP environment.

It is unclear where you are making the decision to keep or remove the pseudoref in the above arrangement that lets the new check_need_delete_cherry_pick_head() decide if the advice is printed or not.

Previous: ZheNing HuNext: ZheNing Hu
Message 11 of 17 in “[GSOC] cherry-pick: fix bug when used with GIT_CHERRY_PICK_HELP”
  1. [GSOC] cherry-pick: fix bug when used with GIT_CHERRY_PICK_HELPZheNing Hu via GitGitGadget, Jul 22, 2021
  2. Junio C HamanoJul 22, 2021
  3. ZheNing HuJul 23, 2021
  4. Felipe ContrerasJul 23, 2021
  5. [GSOC] cherry-pick: fix bug when used with GIT_CHERRY_PICK_HELPZheNing Hu via GitGitGadget, Jul 24, 2021
  6. Phillip WoodJul 27, 2021
  7. Junio C HamanoJul 27, 2021
  8. Junio C HamanoJul 27, 2021
  9. Phillip WoodJul 28, 2021
  10. ZheNing HuJul 28, 2021
  11. Junio C HamanoJul 28, 2021
  12. ZheNing HuJul 28, 2021
  13. Junio C HamanoJul 28, 2021
  14. ZheNing HuJul 28, 2021
  15. Phillip WoodJul 28, 2021
  16. ZheNing HuJul 28, 2021
  17. Phillip WoodJul 28, 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.