From: Jeff King <peff@peff.net>
To: Tummala Dhanvi <dhanvicse@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: Minor bug report
Date: Wed, 3 Jun 2015 02:20:05 -0400 [thread overview]
Message-ID: <20150603062005.GA20580@peff.net> (raw)
In-Reply-To: <CAMOUyJ_2snCaKcWNoOgH7aoHrdbUsCucqu_W_J3aH9_QQe1jEw@mail.gmail.com>
On Wed, Jun 03, 2015 at 11:24:19AM +0530, Tummala Dhanvi wrote:
> 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
next prev parent reply other threads:[~2015-06-03 6:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-03 5:54 Minor bug report Tummala Dhanvi
2015-06-03 6:20 ` Jeff King [this message]
2015-06-03 6:48 ` Junio C Hamano
2015-06-03 8:14 ` [PATCH] log: diagnose empty HEAD more clearly Jeff King
2015-06-03 17:24 ` Junio C Hamano
2015-06-04 7:31 ` Stefan Näwe
2015-06-04 8:45 ` Jeff King
2015-06-04 8:34 ` Jeff King
2015-06-05 20:47 ` Junio C Hamano
2015-06-03 15:39 ` Minor bug report Dennis Kaarsemaker
2015-06-04 8:21 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150603062005.GA20580@peff.net \
--to=peff@peff.net \
--cc=dhanvicse@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).