git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: Robert Eisele <robert@xarg.org>, git@vger.kernel.org
Subject: Re: Bug: Git rename does not work if folder naming was changed from lower to upper case on OSX
Date: Sat, 29 Apr 2017 17:17:33 +0200	[thread overview]
Message-ID: <0f4f39c3-5c8f-8b3b-999b-57b9e3f27ac6@web.de> (raw)
In-Reply-To: <10d4f73b-b4bd-4cf8-5727-cdaf10ab713a@xarg.org>


>
> after having committed folders with lower case naming, I decided to rename them
> to upper-case names. Expecting git to detect them as renamings, it started a
> new parallel hierarchy with new files, which I had to add/commit.
>
> It was a kinda strange behavior, which I fixed by rename the folder to
> something completely different, commit and rename the folder again to the
> desired value.
>
> Is this an actual desired behavior or is it a bug?

It is expected (but may be unexpected), I hope these hints are not too harsh:
You can blame the vendor of the OS,
who decided to design a file system which ignores the case of files.
(Or yourself, because you use it)
(Or yourself, because you can install a HFS+ partition under OSX which
is NOT case insensitive, but few people seem to know about this or use it)
(harsh mode off)

The correct way to rename a file under Git is to use Git:

git init
Initialized empty Git repository in /private/tmp/ttt/.git/
user@Mac:/tmp/ttt>mkdir dir1
user@Mac:/tmp/ttt>echo File >dir1/file
user@Mac:/tmp/ttt>git add dir1/file
user@Mac:/tmp/ttt>git commit -m "add dir1/file"
[master (root-commit) 14d3862] add dir1/file
  1 file changed, 1 insertion(+)
  create mode 100644 dir1/file
user@Mac:/tmp/ttt>git mv dir1/file DIR1/FILE
user@Mac:/tmp/ttt>git commit  "mv dir1/file DIR1/FILE"
user@Mac:/tmp/ttt>git ls-files
DIR1/FILE


>
> Robert
>

  reply	other threads:[~2017-04-29 15:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-29 10:47 Bug: Git rename does not work if folder naming was changed from lower to upper case on OSX Robert Eisele
2017-04-29 15:17 ` Torsten Bögershausen [this message]
2017-04-29 20:18 ` Kevin Daudt
2017-05-01  1:47   ` Junio C Hamano
2017-05-01 17:07     ` Kevin Daudt

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=0f4f39c3-5c8f-8b3b-999b-57b9e3f27ac6@web.de \
    --to=tboegi@web.de \
    --cc=git@vger.kernel.org \
    --cc=robert@xarg.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).