Re: git's is_inside_git_dir too strict?
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Mar 7, 2007, 12:17 UTC
- Message-ID
- <fcaeb9bf0703070417n5d3fb168jc7efd4642ad38c92@mail.gmail.com>
- In-Reply-To
- <Pine.LNX.4.63.0703062232570.22628@wbgn013.biozentrum.uni-wuerzburg.de>
On 3/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 8 quoted lines
> > Complaints include "cannot be used without a working tree" and "This > > operation must be run in a work tree". Can I have the former behaviour > > back in some ways? > > Well, there is a real problem with "This operation must be run in a work > tree". What operation is that? We tried to make it hard to overwrite > things in $GIT_DIR by running Git operations meant for the working tree, > and it seems like you are running one of them.
>From this command:
git --git-dir=/home/pclouds/blog/data.git ls-files --others --modified 2007-03-07T18_52_41.txt
It was run in /home/pclouds/blog/data, which is the working directory of data.git.
By the way, is it plausible to add --git-workdir option to specify working directory? With that option, I won't need to chdir to the working directory, run git commands and chdir back.
Show 9 quoted lines
> > However, I think that is_bare_repository() really should check if > $GIT_DIR is a prefix of $(pwd). Because if it is not, we are likely to run > in a detached work tree. > > If you agree, then is_inside_git_dir() might actually be a better way to > ask if the repo is bare than is_bare_repository(). > > Comments?
I didn't follow git development lately so I'm afraid I'm incapable to comment on this :-)
Show 5 quoted lines
> > Ciao, > Dscho > >
-- Duy