Re: git's is_inside_git_dir too strict?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Tue, 6 Mar 2007, Nguyen Thai Ngoc Duy wrote:

> I have a working directory separated from its git repository. When I
> work on this directory, I specify --git-dir argument (actually all
> happens in script so I don't have to type that much). It used to work
> but no longer since git 1.5.0.

Yes, we tried to make sure a few common errors were harder to make.

> 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.

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?

Ciao,
Dscho

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]