From: Jean-Luc Herren <jlh@gmx.ch>
To: git@vger.kernel.org
Subject: "git rev-parse --git-dir" fails from inside .git/<any-subdir>
Date: Wed, 19 Mar 2008 00:38:28 +0100 [thread overview]
Message-ID: <47E05274.3070908@gmx.ch> (raw)
Hello list!
I noticed that "git rev-parse --git-dir" doesn't work properly
when called from inside a sub-directory of .git. It seems
setup_git_directory_gently() is the problem, because it simply
calls chdir("..") until "." is a valid git directory and it then
sets GIT_DIR = ".". But this relative path only works as long as
you stay in the directory that setup_git_directory_gently() has
put you in. It won't work when git-sh-setup uses GIT_DIR=$(git
rev-parse --git-dir).
This causes "git repack -a -f" to fail with "Nothing new to pack."
from inside .git/objects/pack, which would be handy to test
different parameters and compare the resulting pack files.
I don't know whether setup_git_directory_gently() or rather
builtin-rev-parse.c needs to be changed, I'll let someone else do
this as I don't know the code base well enough.
jlh
reply other threads:[~2008-03-19 21:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=47E05274.3070908@gmx.ch \
--to=jlh@gmx.ch \
--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 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).