git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Dan Loewenherz <dloewenherz@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Does changing filename case breaks git's rename heuristic?
Date: Fri, 27 Aug 2010 10:00:16 +0200	[thread overview]
Message-ID: <4C777090.2000107@drmicha.warpmail.net> (raw)
In-Reply-To: <AANLkTinxvj85Jzb-ykK0=MmRHkz8aQzmVxexC8H+Xgno@mail.gmail.com>

Dan Loewenherz venit, vidit, dixit 27.08.2010 06:57:
> 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(-)

? You have not added any file, so git won't commit anything (not even
with -a). The above can't be a complete transcription. I assume you've
added readme with the content above.

> 
> For personal reasons, I now want readme to be uppercase.
> 
> $ mv readme README

Here's where using "git mv" would have been the easier choice, followed
by commit.

> $ cat > README
> This is the revised README.

Renaming and changing the content completely in one step will always
trip up git's rename detection. You should rename, commit, change,
commit, unless the change affects a small portion of the file only.

> $ git status -sb
> ## master
>  M readme

Again, this can't be a complete transcript. The above would lead to

 D readme
?? README

> $ git add README
> $ git status -sb
> ## master
>  M readme
> 
> At this point, I'm thinking that git is confused. Even though I've

Are you possibly using a case-challenged file system? Is this maybe on a
Mac with HFS or Win with NTFS?

Michael

  parent reply	other threads:[~2010-08-27  8:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=4C777090.2000107@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=dloewenherz@gmail.com \
    --cc=git@vger.kernel.org \
    /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).