Junio C Hamano <gitster@xxxxxxxxx> 于2021年8月4日周三 上午6:36写道: > > > GIT_CHERRY_PICK_HELP value in run_specific_rebase(). > > "help realize the rebasing steps" did not tell us much on "how" the > environment variable helps or what it is used for. A sentence at > this point, e.g. > > The variable carries a custom help message to be shown when one > step of replaying an existing commit fails in conflict. > > may help. And there is one leap in the logic flow here. > > However, the code also removes CHERRY_PICK_HEAD pseudoref when > this environment variable exists, assuming that the presence of > it means the sequencer machinery and not end-user is doing the > cherry-picking. > Thanks, such a supplement is very good. > Hmph, this is a bit troubling. So has this been part of the > "published" behaviour since d7e5c0cb (Introduce CHERRY_PICK_HEAD, > 2011-02-19) that introduced this test, and there are people who are > relying on it? IOW, should the resolution to the original problem > report have been "if it hurts, don't do it" (in other words, "setting > GIT_CHERRY_PICK_HELP will remove CHERRY_PICK_HEAD, so if you do not > want to get the latter removed, do not set the former")? > You mean that cherry_pick with GIT_CHERRY_PICK_HELP suppresses CHERRY_PICK_HEAD is not even a bug? It is reasonable for `git rebase -p` and `git rebase -m` to delete CHERRY_PICK_HEAD when a conflict occurs, but it is not necessarily for git cherry-pick to delete it too. IOW, I suspect that instead of letting users not touch the trap here, it is better to remove the trap completely. Thanks. -- ZheNing Hu