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

[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.1

I'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

Next: Jeff King
Message 1 of 15 in “[BUG] git cherry-pick does not complain about unknown options”
  1. Andrei RybakJul 9, 2018
  2. Jeff KingJul 9, 2018
  3. 0/2 de-confuse git cherry-pick --author behaviorJeff King, Jul 9, 2018
  4. 1/2 sequencer: handle empty-set cases consistentlyJeff King, Jul 9, 2018
  5. Junio C HamanoJul 9, 2018
  6. Johannes SchindelinJul 9, 2018
  7. 2/2 sequencer: don't say BUG on bogus inputJeff King, Jul 9, 2018
  8. Johannes SchindelinJul 9, 2018
  9. Junio C HamanoJul 9, 2018
  10. Jeff KingJul 10, 2018
  11. 0/2 de-confuse git cherry-pick --authorJeff King, Jul 10, 2018
  12. 1/2 sequencer: handle empty-set cases consistentlyJeff King, Jul 10, 2018
  13. 2/2 sequencer: don't say BUG on bogus inputJeff King, Jul 10, 2018
  14. Johannes SchindelinJul 11, 2018
  15. Junio C HamanoJul 11, 2018

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.