git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: Tim Abell <tim@timwise.co.uk>
Cc: git@vger.kernel.org, Erik Faye-Lund <kusmabite@gmail.com>,
	Nguyen Thai Ngoc Duy <pclouds@gmail.com>,
	msysGit <msysgit@googlegroups.com>
Subject: Re: [PATCH] Handle rename of case only, for Windows
Date: Thu, 10 Feb 2011 18:58:14 +0000	[thread overview]
Message-ID: <4D543546.1030207@ramsay1.demon.co.uk> (raw)
In-Reply-To: <1296344717.25999.1417928123@webmail.messagingengine.com>

[Sorry for the late reply to this... I'm somewhat backed-up!]

Tim Abell wrote:
>>From ddab003ede9f25d93f4e7eea833523a0aa29d16d Mon Sep 17 00:00:00 2001
> From: Tim Abell <tim@timwise.co.uk>
> Date: Thu, 27 Jan 2011 22:53:31 +0000
> Subject: [PATCH] Handle rename of case only, for Windows

This should not work with the MinGW or msvc build, since they *always* set
the st_ino to zero (see do_lstat() and mingw_fstat() in compat/mingw.c).
Also, *with default configuration*, it will also not work on cygwin... so
saying that this works on Windows may be overstating things a bit ... ;-)

[Hmm, I can't check, but it would probably work on Mac OS X ...]

> Added test to show rename failing in windows.

This fails for me. (er... just to be clear, test #30 fails with your patch
applied).

> Added test to show that this patch doesn't break protection against overwriting
> an existing file, and another to show that "mv --force" still works.
> 
> Altered mv.c to check whether the source and destination file are actually
> the same file based on inode number before failing.
> If the inode is zero then the data is no use so old behaviour is maintained.

With default configuration, the st_ino will always be zero on cygwin. (see for
example the "schizophrenic l/stat() functions" commits adbc0b6, 7faee6b and
7974843, along with the "force core.filemode" commit c869753).

So, you must have core.filemode or core.ignorecygwinfstricks set somewhere in
your environment (in the system or global (user) config files?).

[I *always* set core.filemode after git-init or git-clone, so this patch may
actually work for me *in practice* (I haven't tested it), but I may well not
be a typical user...]

>> Hmm, not so good. st_ino is always 0 on Windows, so this would make
>> false positives, no?
> 
> I tested this on windows 7 under cygwin (which is what I have available) and st_ino reports real numbers for me,

Again, you must have non-default configuration set...

ATB,
Ramsay Jones

  parent reply	other threads:[~2011-02-10 19:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-29 23:45 [PATCH] Handle rename of case only, for Windows Tim Abell
2011-01-30  2:22 ` René Scharfe
2011-01-30 16:53   ` Tim Abell
2011-01-30 21:39     ` Jonathan Nieder
2011-02-10 18:58 ` Ramsay Jones [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-01-14 13:44 [PATCH] handle rename of case only, for windows Tim Abell
2011-01-14 14:17 ` Nguyen Thai Ngoc Duy
2011-01-14 13:41 Tim Abell
2011-01-14 14:22 ` Erik Faye-Lund

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D543546.1030207@ramsay1.demon.co.uk \
    --to=ramsay@ramsay1.demon.co.uk \
    --cc=git@vger.kernel.org \
    --cc=kusmabite@gmail.com \
    --cc=msysgit@googlegroups.com \
    --cc=pclouds@gmail.com \
    --cc=tim@timwise.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).