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