Re: Minor bug report
- From
Jeff King <peff@peff.net>
- Date
- Jun 3, 2015, 06:20 UTC
- Message-ID
- <20150603062005.GA20580@peff.net>
- In-Reply-To
- <CAMOUyJ_2snCaKcWNoOgH7aoHrdbUsCucqu_W_J3aH9_QQe1jEw@mail.gmail.com>
On Wed, Jun 03, 2015 at 11:24:19AM +0530, Tummala Dhanvi wrote:
Show 10 quoted lines
> When we do create a new empty git repo using git init or create a > orphan branch and do a git log then I am getting an error saying that > fatal: bad default revision 'HEAD' > > Well the error should have been something like no commits to show > either the branch is orphan / you didn't make any commits in the new > repo > > I would like to fix the trival bug myself can some one point me in the > right direction to fix it
Here are some prior discussions:
http://thread.gmane.org/gmane.comp.version-control.git/75692
http://thread.gmane.org/gmane.comp.version-control.git/200504
I just skimmed through them, but I expect the most desirable solution would involve:
1. We still die(), but just improve the error message (so we don't
have any regressions for people expecting "git log" to fail). 2. We use the message only when pointing to an unborn branch, and not
on other errors. The simplest way to do this is probably to make an
extra call to resolve_ref() in the error code-path.-Peff