[BUG] git cherry-pick does not complain about unknown options
- From
Andrei Rybak <rybak.a.v@gmail.com>
- Date
- Jul 9, 2018, 14:16 UTC
- Message-ID
- <33d3e45b-1245-9e2f-42ea-a654a593bf10@gmail.com>
Hi,
I was trying to cherry pick commits, while simultaneously changing the author. Unfortunately, cherry-pick doesn't have the same --author option as git-commit. However, instead of complaining about unknown option:
- when trying to cherry-pick one commit, it reported a BUG - when trying to cherry-pick several commits, cherry-pick silently did nothing
All commits in tests existed in repository:
$ git cherry-pick --author='TEST' <one-commit> # case 1
error: BUG: expected exactly one commit from walk
fatal: cherry-pick failed
$ echo $?
128
$ git cherry-pick --author='TEST' <commit1> <commit2> # case 2
$ echo $?
0
$ git --version
git version 2.18.0.windows.1I've encountered this issue in Windows version, and Johannes Schindelin has confirmed that the issue is also present in Linux version.
Originally reported here: https://github.com/git-for-windows/git/issues/1751
-- Best regards, Andrei Rybak