Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Richard Curnow <rc@rc0.org.uk>
Cc: git@vger.kernel.org
Subject: Re: git push to a local directory with no .git in it
Date: Thu, 29 Sep 2005 17:05:33 -0700	[thread overview]
Message-ID: <7v7jcze7xu.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <loom.20050930T011606-58@post.gmane.org> (Richard Curnow's message of "Thu, 29 Sep 2005 23:25:59 +0000 (UTC)")

Richard Curnow <rc@rc0.org.uk> writes:

> I get
>
> fatal: /home/richard/homepage/git/mairix.git doesn't appear to be a git directory
>
> presumably because there is no .git in it.

Please don't presume, but dig.

        $ git grep -n 'doesn.t appear to be'
        receive-pack.c:275:		die("%s doesn't appear to be a git directory", dir);

And the lines around there are:

	/* chdir to the directory. If that fails, try appending ".git" */
	if (chdir(dir) < 0) {
		if (chdir(mkpath("%s.git", dir)) < 0)
			die("unable to cd to %s", dir);
	}

	/* If we have a ".git" directory, chdir to it */
	chdir(".git");
	putenv("GIT_DIR=.");

	if (access("objects", X_OK) < 0 || access("refs/heads", X_OK) < 0)
		die("%s doesn't appear to be a git directory", dir);
	write_head_info();

We chdir to mairix.git/, and then try to chdir to .git beneath
it _if_ _exists_; we do not care if the second chdir fails.  So
if you do not have mairix.git/.git, that's OK.  We will stay in
mairix.git/ directory and then set the GIT_DIR there.

If you do not have mairix.git/objects or mairix.git/refs/heads/
then that's when you get that error message.

	$ cd /home/richard/homepage/git/mairix.git
        $ ls -ld objects refs refs/heads

would tell us more.

        

  reply	other threads:[~2005-09-30  0:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-29 23:25 git push to a local directory with no .git in it Richard Curnow
2005-09-30  0:05 ` Junio C Hamano [this message]
2005-09-30 22:51   ` Richard Curnow

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=7v7jcze7xu.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=rc@rc0.org.uk \
    /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