git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	Tummala Dhanvi <dhanvicse@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Minor bug report
Date: Thu, 4 Jun 2015 04:21:25 -0400	[thread overview]
Message-ID: <20150604082125.GA5771@peff.net> (raw)
In-Reply-To: <1433345954.21083.14.camel@kaarsemaker.net>

On Wed, Jun 03, 2015 at 05:39:14PM +0200, Dennis Kaarsemaker wrote:

> On di, 2015-06-02 at 23:48 -0700, Junio C Hamano wrote:
> > 
> > I am kind of surprised after reading these two threads that my
> > take on this issue has changed over time, as my knee-jerk
> > reaction before reading them was the opposite, something
> > along the lines of "This is only immediately after 'git init'; why
> > bother?". Or depending on my mood, that "How stupid do you
> > have to be..." sounds exactly like a message I may advocate
> > for us to send. Perhaps I grew more bitter with age.
> 
> The "fatal: Failed to resolve 'HEAD' as a valid ref." message, closely
> related to the "fatal: bad default revision 'HEAD'" message that started
> this thread just came by in #git with the following situation:
> 
> $ git init
> $ git add .
> # Oops, didn't want to add foo.xyz
> $ git reset foo.xyz
> fatal: Failed to resolve 'HEAD' as a valid ref.
> 
> The solution there is simple, git rm --cached, but I think git could
> produce more helpful messages when a repo is empty.

Yeah, I think there are a lot of places we could handle unborn branches
better. We've slowly been smoothing these rough edges over the years
(usually by using the empty tree when we wanted HEAD to be a tree-ish).

Patches welcome. :)

-Peff

      reply	other threads:[~2015-06-04  8:21 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
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 [this message]

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=20150604082125.GA5771@peff.net \
    --to=peff@peff.net \
    --cc=dennis@kaarsemaker.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).