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

Re: [RFC PATCH] cherry-pick: set default `--mainline` parent to 1

From
Duy Nguyen <pclouds@gmail.com>
Date
Mar 20, 2019, 09:44 UTC
Message-ID
<CACsJy8Av87XHBX0EKS3W-yZ0yKxfa47d9NaAeUGmh5icGiTGYw@mail.gmail.com>
In-Reply-To
<CALm+SVJR5BCHi_r7B279gKDukD4mYDQuv=K5guje73YDVmOxug@mail.gmail.com>
On Wed, Mar 20, 2019 at 10:57 AM C.J. Jameson <cjcjameson@gmail.com> wrote:
> --m parent-number::
> ---mainline parent-number::
> +-m [parent-number]::

Careful with this. Optional argument with a short option means the "stuck" form which is known to cause confusion [1].

Try "git revert -mX HEAD" and "git revert -m X HEAD". The first one reports invalid number (good). The second assumes "X" not to be an argument of "-m" and leave it for the caller (revert in this case) to handle, which could do unexpected things.

Personally I'm not excited to have more stuck forms like this.
[1] https://public-inbox.org/git/20190208024800.GA11392@sigill.intra.peff.net/
Show 7 quoted lines
> +--mainline [parent-number]::
>   Usually you cannot cherry-pick a merge because you do not know which
>   side of the merge should be considered the mainline.  This
>   option specifies the parent number (starting from 1) of
>   the mainline and allows cherry-pick to replay the change
> - relative to the specified parent.
> + relative to the specified parent. The default parent-number is 1.

-- Duy

Previous: Johannes Schindelin
Message 23 of 23 in “cherry-pick: set default `--mainline` parent to 1”
  1. cherry-pick: set default `--mainline` parent to 1C.J. Jameson, Mar 20, 2019
  2. Junio C HamanoMar 20, 2019
  3. Sergey OrganovMar 20, 2019
  4. Elijah NewrenMar 20, 2019
  5. Sergey OrganovMar 20, 2019
  6. C.J. JamesonMar 21, 2019
  7. Junio C HamanoMar 21, 2019
  8. Junio C HamanoMar 21, 2019
  9. Sergey OrganovMar 21, 2019
  10. Junio C HamanoMar 21, 2019
  11. Sergey OrganovMar 21, 2019
  12. Junio C HamanoMar 21, 2019
  13. Junio C HamanoMar 21, 2019
  14. Sergey OrganovMar 21, 2019
  15. Junio C HamanoMar 22, 2019
  16. Sergey OrganovMar 22, 2019
  17. C.J. JamesonMar 22, 2019
  18. Johannes SchindelinMar 25, 2019
  19. C.J. JamesonMar 25, 2019
  20. Sergey OrganovMar 21, 2019
  21. Johannes SchindelinMar 22, 2019
  22. Johannes SchindelinMar 22, 2019
  23. Duy NguyenMar 20, 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.