This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Git issue.


I've run into a problem when using the --git-dir option in git. It appears to have been introduced since git 2.4.x.

Here's an example of the problem using a locally built version (2.6.3) of git with some annotated error output:

[/cygdrive/d/projects]
$ git --version
git version 2.6.3-cyg

[/cygdrive/d/projects]
$ git --git-dir=d:/projects/git-git/.git config alias.foo ls-files
error: Unable to open tempfile: /cygdrive/d/projects/d:/projects/git-git/.git/config.lock
error: could not lock config file d:/projects/git-git/.git/config: No such file or directory

The problem is that the code that is checking the --git-dir option doesn't work properly if you use a DOS drive:/path specification. I tracked it down to the fact that has_dos_drive_prefix() is not implemented and always returns false.  From git-compat-util.h:

#ifndef has_dos_drive_prefix 
static inline int git_has_dos_drive_prefix(const char *path) 
{ 
return 0; 
} 
#define has_dos_drive_prefix git_has_dos_drive_prefix 
#endif 

It looks like there is an implementation of the function for a MinGW build (compat/mingw.c) but not for the Cygwin build. There were changes in this area about a year ago, but I'm not exactly sure what changed to cause this problem to appear.

Thanks. 

-Matt 

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]