git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Reece Dunn" <msclrhd@googlemail.com>
To: "Jeff King" <peff@peff.net>
Cc: Git <git@vger.kernel.org>
Subject: Re: Some issues working with empty/bare repositories...
Date: Tue, 4 Mar 2008 21:51:02 +0000	[thread overview]
Message-ID: <3f4fd2640803041351k6debe788xbf5e818951f70146@mail.gmail.com> (raw)
In-Reply-To: <20080303081021.GA6578@sigill.intra.peff.net>

On 03/03/2008, Jeff King <peff@peff.net> wrote:
> On Sat, Mar 01, 2008 at 07:40:39PM +0000, Reece Dunn wrote:
>
>  > Consider the following workflow:
>  >
>  >     $ mkdir foo
>  >     $ cd foo
>  >     $ git --bare init
>  >
>  >     $ git log
>  >     fatal: bad default revision 'HEAD'
>  >
>  > This message is confusing for a newbie. Displaying "no commits" would
>  > make more sense here.
>
> The tricky thing here is that "git log" doesn't know we have no
>  commits in the repo; it only knows that HEAD is bogus. But it may be
>  that we can just say something like:
>
>   fatal: unable to resolve HEAD; do you have any commits?

That would be better. The current message would indicate something
like a corrupt repository (or at least the metadata to the
repository).

>  >     $ git clone foo bar
>  >     Initialized empty Git repository in /home/reece/bar/.git/
>  >     $ ls -a /home/reece
>  >     . .. foo
>
> As of 1.5.4, this now says "fatal: cannot clone empty repository". There
>  has been work recently on a C version of clone which tries to match the
>  sequence of "init && remote add && fetch && checkout" more closely. I
>  haven't looked closely, but I suspect it may just work (by which I mean
>  create an empty repo with origin config pointing to the parent repo).

I have verified that behaviour with 1.5.4. Having an empty repository
(possibly with a warning issued about cloning an empty repository)
with the origin pointing to the parent repository is what I would
expect to happen.

>  > It appears from the git output (with the inconsistently capitalized
>  > git - see --version output above) that the clone succeeded, but it
>  > does not create bar/.git/, even though it said that it did.
>
> It did create it...it just deleted it afterwards without telling you. :)

:)

Thanks,
- Reece

  reply	other threads:[~2008-03-04 21:51 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 [this message]
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

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=3f4fd2640803041351k6debe788xbf5e818951f70146@mail.gmail.com \
    --to=msclrhd@googlemail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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).