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

Ambiguous reference weirdness

From
Phil Hord <phil.hord@gmail.com>
Date
Feb 22, 2012, 01:46 UTC
Message-ID
<CABURp0oAw7cvU7cwCZOtvqZ_oa0hDPsE_0Lm3kR1ctdNuxU3hg@mail.gmail.com>
I accidentally ran into this today:
    $ git cherry-pick 1147
    fatal: BUG: expected exactly one commit from walk
git log shows no output:
    $ git log 1147

Neither of these are very helpful or reassuring. I tried a few things but I haven't looked the code yet. I found lots of inconsistencies along the way.

$ git clone https://github.com/git/git $ cd git

$git log 114 fatal: ambiguous argument '114': unknown revision or path not in the working tree. Use '--' to separate paths from revisions

$ git checkout 114 error: pathspec '114' did not match any file(s) known to git. $ git merge 114 fatal: '114' does not point to a commit $ git cherry-pick 114 fatal: ambiguous argument '114': unknown revision or path not in the working tree. Use '--' to separate paths from revisions

$ git checkout 1147 fatal: reference is not a tree: 1147 $ git merge 1147 error: 1147: expected commit type, but the object dereferences to blob type fatal: '1147' does not point to a commit $ git cherry-pick 1147 fatal: BUG: expected exactly one commit from walk $ git log 1147

$ git checkout 1146 error: short SHA1 1146 is ambiguous. error: pathspec '1146' did not match any file(s) known to git. $ git merge 1146 error: short SHA1 1146 is ambiguous. fatal: '1146' does not point to a commit $ git cherry-pick 1146 error: short SHA1 1146 is ambiguous. error: short SHA1 1146 is ambiguous. fatal: ambiguous argument '1146': unknown revision or path not in the working tree. Use '--' to separate paths from revisions $ git log 1146 error: short SHA1 1146 is ambiguous. error: short SHA1 1146 is ambiguous. fatal: ambiguous argument '1146': unknown revision or path not in the working tree. Use '--' to separate paths from revisions

I can understand some of the inconsistent error reporting (checkout may expect filenames, but cherry-pick and merge do not). But this seems too varied to me.

And the first two look like bugs.
Any comments or suggestions?
Phil
Next: Jeff King
Message 1 of 4 in “Ambiguous reference weirdness”
  1. Phil HordFeb 22, 2012
  2. Jeff KingFeb 22, 2012
  3. Phil HordFeb 22, 2012
  4. Jeff KingFeb 22, 2012

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.