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

Re: [RFC] improve 'bad default revision' message for empty repo

From
Jeff King <peff@peff.net>
Date
Mar 5, 2008, 09:25 UTC
Message-ID
<20080305092555.GA18591@sigill.intra.peff.net>
In-Reply-To
<20080305091051.GA18377@sigill.intra.peff.net>
On Wed, Mar 05, 2008 at 04:10:51AM -0500, Jeff King wrote:
Show 5 quoted lines
> Hrm. Thinking about it a bit more, what should be done with a --default
> like "HEAD^^"? It currently works fine, but parsing it down to "HEAD"
> requires the magic of get_sha1_with_mode. I think anyone using anything
> but an unadorned refname for --default is probably insane, though. Would
> it be acceptable to formally disallow it?

Hrm. Even if we took this down to the level of resolve_ref(), there still is no distinction being made between "does not exist" and other errors. So restricting what is allowed in --default doesn't solve anything anyway (though it does make the call stack much smaller, which makes a modifiction to pass an error/not-found condition back a less painful change).

But given that no distinction is made currently for something like "git show foobar" between "you don't have foobar" and "foobar is somehow corrupt", I am inclined to just say "any errors in default lookup are ignored."

-Peff
Previous: Jeff King
Message 9 of 9 in “Some issues working with empty/bare repositories...”
  1. Reece DunnMar 1, 2008
  2. Jeff KingMar 3, 2008
  3. Reece DunnMar 4, 2008
  4. [RFC] improve 'bad default revision' message for empty repoJeff King, Mar 5, 2008
  5. Junio C HamanoMar 5, 2008
  6. Jeff KingMar 5, 2008
  7. Junio C HamanoMar 5, 2008
  8. Jeff KingMar 5, 2008
  9. Jeff KingMar 5, 2008

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.