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

rev-list and "ambiguous" IDs

From
Bryan Turner <bturner@atlassian.com>
Date
Nov 14, 2019, 04:35 UTC
Message-ID
<CAGyf7-EXOUWYUZXmww2+NyD1OuWEG18n221MPojVSCCu=19JNA@mail.gmail.com>

When using a command like `git rev-list dc41e --`, it's possible to get output like this: (from newer Git versions) error: short SHA1 dc41e is ambiguous hint: The candidates are: hint: dc41eeb01ba commit 2012-11-23 - Stuff from the commit message hint: dc41e0d508b tree hint: dc41e5bef41 tree hint: dc41e11ee18 blob fatal: bad revision 'dc41e'

Is there any way to ask rev-list to be a little...pickier about what it considers a candidate? Almost without question the two trees and the blob aren't what I'm asking for, which means there's actually only one real candidate.

Also, while considering this, I noticed that `git rev-list dc41e11ee18` (the blob from the output above) doesn't fail. It silently exits, nothing written to stdout or stderr, with 0 status. A little surprising; I would have expected rev-list to complain that dc41e11ee18 isn't a valid commit-ish value.

Bryan
Next: Jeff King
Message 1 of 13 in “rev-list and "ambiguous" IDs”
  1. Bryan TurnerNov 14, 2019
  2. Jeff KingNov 14, 2019
  3. Thomas BraunNov 15, 2019
  4. Bryan TurnerNov 15, 2019
  5. Jeff KingNov 15, 2019
  6. Jeff KingNov 15, 2019
  7. Junio C HamanoNov 15, 2019
  8. Jeff KingNov 15, 2019
  9. Junio C HamanoNov 15, 2019
  10. Thomas BraunNov 15, 2019
  11. Junio C HamanoNov 16, 2019
  12. Jeff KingNov 18, 2019
  13. Junio C HamanoNov 19, 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.