git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Cygwin git and windows network shares

From
CFChristopher Faylor <me@cgf.cx>
Date
Jun 16, 2006, 22:30 UTC
Message-ID
<20060616223006.GA23737@trixie.casa.cgf.cx>
In-Reply-To
<20060616221014.GA22181@trixie.casa.cgf.cx>
On Fri, Jun 16, 2006 at 06:10:14PM -0400, Christopher Faylor wrote:
Show 18 quoted lines
>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.
Show 12 quoted lines
>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)

Previous: Christopher FaylorNext: Juergen Ruehle
Message 4 of 6 in “Cygwin git and windows network shares”
  1. Niklas FrykholmJun 16, 2006
  2. Juergen RuehleJun 16, 2006
  3. Christopher FaylorJun 16, 2006
  4. Christopher FaylorJun 16, 2006
  5. Juergen RuehleJun 17, 2006
  6. Christopher FaylorJun 17, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.