git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Reece Dunn <msclrhd@googlemail.com>
Subject: Re: [RFC] improve 'bad default revision' message for empty repo
Date: Wed, 5 Mar 2008 04:25:56 -0500	[thread overview]
Message-ID: <20080305092555.GA18591@sigill.intra.peff.net> (raw)
In-Reply-To: <20080305091051.GA18377@sigill.intra.peff.net>

On Wed, Mar 05, 2008 at 04:10:51AM -0500, Jeff King wrote:

> 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

      reply	other threads:[~2008-03-05  9:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-01 19:40 Some issues working with empty/bare repositories Reece Dunn
2008-03-03  8:10 ` Jeff King
2008-03-04 21:51   ` Reece Dunn
2008-03-05  1:07     ` [RFC] improve 'bad default revision' message for empty repo Jeff King
2008-03-05  2:43       ` Junio C Hamano
2008-03-05  4:33         ` Jeff King
2008-03-05  8:48           ` Junio C Hamano
2008-03-05  9:10             ` Jeff King
2008-03-05  9:25               ` 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=20080305092555.GA18591@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=msclrhd@googlemail.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).