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