From: "Britton Kerin" <bkerin@fastmail.fm>
To: git@vger.kernel.org
Subject: confusing GIT_DIR behavior case
Date: Mon, 17 Mar 2008 14:43:49 -0800 [thread overview]
Message-ID: <1205793829.5984.1242927563@webmail.messagingengine.com> (raw)
I'm noob so wanted to see 'git_repo' instead of invisible '.git'.
I tried GIT_DIR=git_repo after looking at
GIT_DIR
If the GIT_DIR environment variable is set then it
specifies a
path to use instead of the default .git for the base of
the
repository.
in the man page plus the usual mantra of
git init
git add .
git commit
in many git noob docs.
But it fails like this:
rhino$ mkdir test
rhino$ cd test
rhino$ export GIT_DIR=git_repo
rhino$ git init
Initialized empty Git repository in git_repo/
rhino$ git add .
fatal: This operation must be run in a work tree
I had to irc to hear that git_repo must be added to info/exclude (even
though '.git' isnt in there :).
Confusingly I was able to grope up a GIT_WORK_TREE setting (I forget
exactly
what) that made 'git add .' work but then 'git commit' failed.
It seems to me that at least one of these options should be useful (I
doubt I
know enought to know which):
1. GIT_DIR (and --git-dir) should make git behave exactly as if git
was
wired to look for $GIT_DIR rather than '.git'. The occurence of
the
GIT_DIR description in the top-level man page (for 'man git')
seems to
suggest that this is how things work.
2. The above man page section should be changed, and --git-dir
option
description should be expanded a bit, or referred to the section
describing GIT_DIR.
3. The above diagnostic should be changed. It looks to me like its
running
some test to determine that its in the repo directory and then
giving
up, presumably because it believes it was erroneously invoked
there. The
error is the first thing that shows up in the above case probably
because
the git_repo is the first directory in a recursive traversal
where there is
a problem. If this is the case it would be a nice clue if it
would spit out
the name of the offending directory.
4. The noob docs should make some mention of this issue.
Cheers,
Britton
next reply other threads:[~2008-03-17 22:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-17 22:43 Britton Kerin [this message]
2008-03-17 23:00 ` confusing GIT_DIR behavior case Junio C Hamano
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=1205793829.5984.1242927563@webmail.messagingengine.com \
--to=bkerin@fastmail.fm \
--cc=git@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.