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

bisect: "Needed a single revision" message is confusing

From
DBDaniel Bonniot <bonniot@gmail.com>
Date
Nov 2, 2012, 13:23 UTC
Message-ID
<CAO5QaZkZYxvSYoAQGgrrH1ULM8rnwX5=0Ln-_zfh8OwdegNNoA@mail.gmail.com>
Hi,
Suppose I'm doing a git bisect, say:
$ git bisect good 8c7a786b6c8eae8eac91083cdc9a6e337bc133b0

That works fine. The sha1 could also be a substring, as long as it's unambiguous, e.g.:

$ git bisect good 8c7a786b6c
Now if it's ambiguous, I get an error message:

$ git bisect good 8 fatal: Needed a single revision Bad rev input: 8

All fine and good. But what if I somehow input a non-existing sha1 (in my case see [1]), e,g:

$ git bisect good 8c7a786b6c8eae8eac91083cdc9a6e337bc133b1 fatal: Needed a single revision Bad rev input: 8c7a786b6c8eae8eac91083cdc9a6e337bc133b1

I understand that technically both "no revision" and "multiple revisions" qualify as "not a single revision", but they correspond to quite different situations. I think it would be more helpful to get different error messages, something like:

Bad rev input: 8 refers to multiple revisions Bad rev input: 8c7a786b6c8eae8eac91083cdc9a6e337bc133b1 does not refer to a valid revision

(and avoid outputing the "fatal: Needed a single revision" message).
Is this a good idea? Anybody can think of better error messages?

I'm not familiar with the code base at all, but I could give a try at implementing it, unless it's trivial enough that someone does it earlier. After a quick look, it looks like either git-bisect itself or rev-parse would need to be touched, any pointers and hints welcome.

Cheers,
Daniel

[1] if you want to know, I got a sha1 from one repository and used it in another, which probably should work, except that when using git-svn they don't. And the "single revision" error message lead me on a tangent.

Next: Michael J Gruber
Message 1 of 2 in “bisect: "Needed a single revision" message is confusing”
  1. Daniel BonniotNov 2, 2012
  2. Michael J GruberNov 2, 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.