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

Re: [PATCH] cherry-pick: do not error on non-merge commits when '-m 1' is specified

From
Sergey Organov <sorganov@gmail.com>
Date
Dec 13, 2018, 06:35 UTC
Message-ID
<87o99qylv5.fsf@javad.com>
In-Reply-To
<xmqqo99qf46q.fsf@gitster-ct.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 19 quoted lines
> Sergey Organov <sorganov@gmail.com> writes:
>
>> When cherry-picking multiple commits, it's impossible to have both
>> merge- and non-merge commits on the same command-line. Not specifying
>> '-m 1' results in cherry-pick refusing to handle merge commits, while
>> specifying '-m 1' fails on non-merge commits.
>>
>> This patch allows '-m 1' for non-merge commits. Besides, as mainline is
>> always the only parent for a non-merge commit, it made little sense to
>> disable it in the first place.
>
> In the original context to pick a single commit, it made perfect
> sense to avoid mistakes by blindly passing '-m 1' to non-merge
> commit.
>
> It may be fair to say that we failed to reconsider what to
> do with '-m 1' when we did 7e2bfd3f, but it is utterly an unfair 
> history revisionism to say that it made little sense to disable it
> in the first place.

In fact I had zero intention on any revisionism. Now I see I should have said "makes little sense" in present tense to avoid touching deep historical issues, sorry!

Something like:

"This patch allows '-m 1' for non-merge commits. As mainline is always the only parent for a non-merge commit, it makes little sense to disable it."

sounds OK?
Show 6 quoted lines
>
> The change to the code itself looks sane, but applying this patch
> alone will break existing tests whose expectations must be updated,
> and this new behaviour must be protected by a new test (or two) so
> that we won't accidentally stop accepting "-m 1" for a single-parent
> commit.
I fixed most of the tests, but
"t3510/4: cherry-pick persists opts correctly"

is an offender for me. It looks like it [ab]uses current "-m 1" behavior just to stop in the middle of the sequence, and I'm not sure how to fix it most suitably.

Thanks!
-- 
Sergey
Previous: Junio C HamanoNext: Sergey Organov
Message 6 of 22 in “cherry-pick: do not error on non-merge commits when '-m 1' is specified”
  1. cherry-pick: do not error on non-merge commits when '-m 1' is specifiedSergey Organov, May 25, 2018
  2. Junio C HamanoJun 21, 2018
  3. Sergey OrganovJun 22, 2018
  4. Sergey OrganovDec 12, 2018
  5. Junio C HamanoDec 13, 2018
  6. Sergey OrganovDec 13, 2018
  7. Sergey OrganovDec 13, 2018
  8. Junio C HamanoDec 14, 2018
  9. 0/4 Allow 'cherry-pick -m 1' for non-merge commitsSergey Organov, Dec 14, 2018
  10. 1/4 t3510: stop using '-m 1' to force failure mid-sequence of cherry-picksSergey Organov, Dec 14, 2018
  11. 2/4 cherry-pick: do not error on non-merge commits when '-m 1' is specifiedSergey Organov, Dec 14, 2018
  12. 3/4 t3502: validate '-m 1' argument is now accepted for non-merge commitsSergey Organov, Dec 14, 2018
  13. 4/4 t3506: validate '-m 1 -ff' is now accepted for non-merge commitsSergey Organov, Dec 14, 2018
  14. Sergey OrganovMar 19, 2019
  15. Junio C HamanoMar 20, 2019
  16. Jeff KingMar 20, 2019
  17. Sergey OrganovMar 25, 2019
  18. Jeff KingMar 26, 2019
  19. Elijah NewrenMar 26, 2019
  20. Jeff KingMar 26, 2019
  21. Elijah NewrenMar 27, 2019
  22. Sergey OrganovMar 27, 2019

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.