git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problems with file name case on Windows.
@ 2010-04-22 20:54 martinvz
  2010-04-23  3:48 ` Tay Ray Chuan
  2010-04-23  6:38 ` Johannes Sixt
  0 siblings, 2 replies; 4+ messages in thread
From: martinvz @ 2010-04-22 20:54 UTC (permalink / raw)
  To: git


Under Cygwin, if you add a file "a" in one commit, then rename the file to
"A" and commit again, both files will be in the new commit. Running the
following line under Cygwin produces a commit with both files ("a" and "A").
Running it on Linux produces a commit with one file ("A"), as expected.

git init; git config core.ignorecase false; touch a; git add a; git commit
-m a; mv a A; git add -A; git commit -m A

The problem seems to be with the "git add -A" part, since it is possible to
get around the problem by running "git add A" followed by "git rm a" (or by
using lower-level commands, I suppose). What are the chances of getting this
fixed? It's mostly annoying when importing existing code where it's harder
to use the add-rm workaround, since you don't know which files have changed
file name case.
-- 
View this message in context: http://git.661346.n2.nabble.com/Problems-with-file-name-case-on-Windows-tp4947131p4947131.html
Sent from the git mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problems with file name case on Windows.
  2010-04-22 20:54 Problems with file name case on Windows martinvz
@ 2010-04-23  3:48 ` Tay Ray Chuan
  2010-04-23  6:38 ` Johannes Sixt
  1 sibling, 0 replies; 4+ messages in thread
From: Tay Ray Chuan @ 2010-04-23  3:48 UTC (permalink / raw)
  To: martinvz; +Cc: git

Hi,

On Fri, Apr 23, 2010 at 4:54 AM, martinvz
<martin.von.zweigbergk@gmail.com> wrote:
> git init; git config core.ignorecase false; touch a; git add a; git commit
> -m a; mv a A; git add -A; git commit -m A

Have you tried

  git mv a A; git commit -m A

instead of

  mv a A; git add -A; git commit -m A

?

-- 
Cheers,
Ray Chuan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problems with file name case on Windows.
  2010-04-22 20:54 Problems with file name case on Windows martinvz
  2010-04-23  3:48 ` Tay Ray Chuan
@ 2010-04-23  6:38 ` Johannes Sixt
  2010-04-23 12:16   ` martinvz
  1 sibling, 1 reply; 4+ messages in thread
From: Johannes Sixt @ 2010-04-23  6:38 UTC (permalink / raw)
  To: martinvz; +Cc: git

Am 22.04.2010 22:54, schrieb martinvz:
>
> Under Cygwin, if you add a file "a" in one commit, then rename the file to
> "A" and commit again, both files will be in the new commit. Running the
> following line under Cygwin produces a commit with both files ("a" and "A").
> Running it on Linux produces a commit with one file ("A"), as expected.

The safe way to achieve your goal is:

   git mv a b
   git mv b A
   git commit

-- Hannes

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problems with file name case on Windows.
  2010-04-23  6:38 ` Johannes Sixt
@ 2010-04-23 12:16   ` martinvz
  0 siblings, 0 replies; 4+ messages in thread
From: martinvz @ 2010-04-23 12:16 UTC (permalink / raw)
  To: git


Thanks, I had forgotten about "git mv". Still, when you receive just a
tarball of code (actually from another VCS in my case), you would have to
figure out which files had been renamed, before you could run the command,
so it is not very useful in scripting in this case. Maybe what I
could/should do is something like "git rm -rf *; <untar> ; git add -A"?

/Martin
-- 
View this message in context: http://git.661346.n2.nabble.com/Problems-with-file-name-case-on-Windows-tp4947131p4950180.html
Sent from the git mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-04-23 12:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-22 20:54 Problems with file name case on Windows martinvz
2010-04-23  3:48 ` Tay Ray Chuan
2010-04-23  6:38 ` Johannes Sixt
2010-04-23 12:16   ` martinvz

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