* "git rev-parse --git-dir" fails from inside .git/<any-subdir>
@ 2008-03-18 23:38 Jean-Luc Herren
0 siblings, 0 replies; only message in thread
From: Jean-Luc Herren @ 2008-03-18 23:38 UTC (permalink / raw)
To: git
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-03-19 21:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-18 23:38 "git rev-parse --git-dir" fails from inside .git/<any-subdir> Jean-Luc Herren
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).