* Cygwin git and windows network shares
@ 2006-06-16 12:58 Niklas Frykholm
2006-06-16 14:24 ` Juergen Ruehle
0 siblings, 1 reply; 6+ messages in thread
From: Niklas Frykholm @ 2006-06-16 12:58 UTC (permalink / raw)
To: git
I'm trying to use cygwin git (compiled from the 1.4.0 tarball) to create
repository on a windows network share, but I get an error message.
$ cd //computer/git/project
$ git init-db
defaulting to local storage area
Could not rename the lock file?
The repository seems to be left in an inconsistent state after this:
$ git clone //computer/git/project/
fatal: no matching remote head
fetch-pack from '//computer/git/project/.git' failed.
When working only with local files, I do not get these errors. Does
anyone know the cause of this error/any way around it?
// Niklas
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Cygwin git and windows network shares 2006-06-16 12:58 Cygwin git and windows network shares Niklas Frykholm @ 2006-06-16 14:24 ` Juergen Ruehle 2006-06-16 22:10 ` Christopher Faylor 2006-06-17 1:02 ` Juergen Ruehle 0 siblings, 2 replies; 6+ messages in thread From: Juergen Ruehle @ 2006-06-16 14:24 UTC (permalink / raw) To: Niklas Frykholm; +Cc: git Niklas Frykholm writes: > I'm trying to use cygwin git (compiled from the 1.4.0 tarball) to create > repository on a windows network share, but I get an error message. > > $ cd //computer/git/project > $ git init-db > defaulting to local storage area > Could not rename the lock file? cygwin's rename seems to be capable of overwriting an existing target only on NTFS. The following hack is a workaround, but is probably not safe. diff --git a/lockfile.c b/lockfile.c index 2346e0e..5e78211 100644 --- a/lockfile.c +++ b/lockfile.c @@ -48,6 +48,7 @@ int commit_lock_file(struct lock_file *l strcpy(result_file, lk->filename); i = strlen(result_file) - 5; /* .lock */ result_file[i] = 0; + unlink(result_file); i = rename(lk->filename, result_file); lk->filename[0] = 0; return i; ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: Cygwin git and windows network shares 2006-06-16 14:24 ` Juergen Ruehle @ 2006-06-16 22:10 ` Christopher Faylor 2006-06-16 22:30 ` Christopher Faylor 2006-06-17 1:02 ` Juergen Ruehle 1 sibling, 1 reply; 6+ messages in thread From: Christopher Faylor @ 2006-06-16 22:10 UTC (permalink / raw) To: Niklas Frykholm, git, Juergen Ruehle On Fri, Jun 16, 2006 at 04:24:30PM +0200, Juergen Ruehle wrote: >Niklas Frykholm writes: > > I'm trying to use cygwin git (compiled from the 1.4.0 tarball) to create > > repository on a windows network share, but I get an error message. > > > > $ cd //computer/git/project > > $ git init-db > > defaulting to local storage area > > Could not rename the lock file? > >cygwin's rename seems to be capable of overwriting an existing target >only on NTFS. The following hack is a workaround, but is probably not >safe. Actually, Cygwin's rename has a specific check to make sure that the file is deleted. It tries very hard to do things the right way but if your samba server doesn't return the correct error code then it is possible that it could be confused. cgf ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cygwin git and windows network shares 2006-06-16 22:10 ` Christopher Faylor @ 2006-06-16 22:30 ` Christopher Faylor [not found] ` <17555.21858.292000.494454@lapjr.intranet.kiel.bmiag.de> 0 siblings, 1 reply; 6+ messages in thread From: Christopher Faylor @ 2006-06-16 22:30 UTC (permalink / raw) To: Niklas Frykholm, git, Juergen Ruehle On Fri, Jun 16, 2006 at 06:10:14PM -0400, Christopher Faylor wrote: >On Fri, Jun 16, 2006 at 04:24:30PM +0200, Juergen Ruehle wrote: >>Niklas Frykholm writes: >> > I'm trying to use cygwin git (compiled from the 1.4.0 tarball) to create >> > repository on a windows network share, but I get an error message. >> > >> > $ cd //computer/git/project >> > $ git init-db >> > defaulting to local storage area >> > Could not rename the lock file? >> >>cygwin's rename seems to be capable of overwriting an existing target >>only on NTFS. The following hack is a workaround, but is probably not >>safe. > >Actually, Cygwin's rename has a specific check to make sure that the >file is deleted. It tries very hard to do things the right way but if >your samba server doesn't return the correct error code then it is >possible that it could be confused. >diff --git a/lockfile.c b/lockfile.c >index 2346e0e..5e78211 100644 >--- a/lockfile.c >+++ b/lockfile.c >@@ -48,6 +48,7 @@ int commit_lock_file(struct lock_file *l > strcpy(result_file, lk->filename); > i = strlen(result_file) - 5; /* .lock */ > result_file[i] = 0; >+ unlink(result_file); > i = rename(lk->filename, result_file); > lk->filename[0] = 0; > return i; I also meant to ask if there was an i is nonzero after the call to the rename() above? If so, what was the errno? If not, it is a huge problem if rename is reporting that it is able to rename a file but is not actually doing it. cgf (cygwin maintainer) ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <17555.21858.292000.494454@lapjr.intranet.kiel.bmiag.de>]
* Re: Cygwin git and windows network shares [not found] ` <17555.21858.292000.494454@lapjr.intranet.kiel.bmiag.de> @ 2006-06-17 1:23 ` Christopher Faylor 0 siblings, 0 replies; 6+ messages in thread From: Christopher Faylor @ 2006-06-17 1:23 UTC (permalink / raw) To: git, Juergen Ruehle On Sat, Jun 17, 2006 at 03:05:38AM +0200, Juergen Ruehle wrote: >Christopher Faylor writes: > > I also meant to ask if there was an i is nonzero after the call to the > > rename() above? If so, what was the errno? If not, it is a huge > > problem if rename is reporting that it is able to rename a file but is > > not actually doing it. > >After some testing the conclusion is that it's not lying, but only >failing in interesting ways on my (and seemingly also Niklas') system: > > - rename on NTFS succeeds (and returns 0) > > - rename on FAT32 succeeds if target does not exist (and returns 0) > > rename on FAT32 fails if target exists with EACCESS > > (manual mv on commandline works) > > - rename on a network share always hangs for a while and then fails > with EBUSY (even if target does not exist) > > (share served by XP, tested both NTFS and FAT32) > > (manual mv still works) > >Various combinations of server, ntsec, and smbntsec didn't seem to >make a difference; /etc/{passwd,group} have been freshly created. Thanks. I really appreciate the details. I've passed them on to the last person to touch the rename code. cgf ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cygwin git and windows network shares 2006-06-16 14:24 ` Juergen Ruehle 2006-06-16 22:10 ` Christopher Faylor @ 2006-06-17 1:02 ` Juergen Ruehle 1 sibling, 0 replies; 6+ messages in thread From: Juergen Ruehle @ 2006-06-17 1:02 UTC (permalink / raw) To: Niklas Frykholm, git Juergen Ruehle writes: > The following hack is a workaround, but is probably not safe. Please just ignore it, it only helps on FAT32 partitions. Sorry for the confusion. jr ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-06-17 1:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-16 12:58 Cygwin git and windows network shares Niklas Frykholm
2006-06-16 14:24 ` Juergen Ruehle
2006-06-16 22:10 ` Christopher Faylor
2006-06-16 22:30 ` Christopher Faylor
[not found] ` <17555.21858.292000.494454@lapjr.intranet.kiel.bmiag.de>
2006-06-17 1:23 ` Christopher Faylor
2006-06-17 1:02 ` Juergen Ruehle
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox