git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Does changing filename case breaks git's rename heuristic?
@ 2010-08-27  4:57 Dan Loewenherz
  2010-08-27  5:36 ` Ramkumar Ramachandra
  2010-08-27  8:00 ` Michael J Gruber
  0 siblings, 2 replies; 8+ messages in thread
From: Dan Loewenherz @ 2010-08-27  4:57 UTC (permalink / raw)
  To: git

Hi all,

I may be mistaking a design decision as a bug, but I wanted to throw
this out to the list to make sure. I think that re-enacting it will be
the best way to explain it.

$ mkdir test
$ cd test
$ git init
$ cat > readme
This is a test file.
^D
$ git commit -am "first commit"
[master (root-commit) fae0d05] first commit
 1 files changed, 1 insertions(+), 0 deletions(-)

For personal reasons, I now want readme to be uppercase.

$ mv readme README
$ cat > README
This is the revised README.
$ git status -sb
## master
 M readme
$ git add README
$ git status -sb
## master
 M readme

At this point, I'm thinking that git is confused. Even though I've
added the README file, it still isn't staged. I follow up with the
obvious:

$ git add readme
$ git status -sb
## master
M  readme
$ git commit -m "change filename"
[master ecc009f] change filename
 1 files changed, 1 insertions(+), 1 deletions(-)

It kind of works, but not quite, since git still thinks the file is
called readme. I'd like to rename it, but whenever I run:

$ git mv readme README
fatal: destination exists, source=readme, destination=README

How about this:

$ mv README README.temp
$ git mv readme README
fatal: bad source, source=readme, destination=README

The only workable solution was this:

$ git mv readme readme.temp
$ git mv readme.temp README

I'm guessing this all has to do in some part with the logic behind
git's strategy for detecting renames. This case probably slipped under
the radar.

-Dan

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

end of thread, other threads:[~2010-08-28 10:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-27  4:57 Does changing filename case breaks git's rename heuristic? Dan Loewenherz
2010-08-27  5:36 ` Ramkumar Ramachandra
2010-08-27  8:00 ` Michael J Gruber
2010-08-27 14:52   ` Dan Loewenherz
2010-08-27 15:46     ` Michael J Gruber
2010-08-27 16:22       ` Stephen Bash
2010-08-27 20:02       ` Jay Soffian
2010-08-28 10:39       ` Ævar Arnfjörð Bjarmason

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