git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* Repo state broken due to mismatched file name casing during merge
@ 2020-09-02 16:26 Rafał Grzybowski
  2020-09-02 23:23 ` brian m. carlson
  0 siblings, 1 reply; 3+ messages in thread
From: Rafał Grzybowski @ 2020-09-02 16:26 UTC (permalink / raw)
  To: git

What did you do before the bug happened? (Steps to reproduce your issue)

mkdir repo
cd repo

git init

"sample file" > file.txt
git add file.txt
git commit -m "Added file.txt"


git checkout -b other_branch
echo other file > other_file.txt
git add other_file.txt
git commit -m "Added other_file.txt"

git checkout master
echo Other file > Other_file.txt
git add Other_file.txt
git commit -m "Added Other_file.txt"

git merge other_branch
git status

What did you expect to happen? (Expected behavior)

A clean state, no unstaged changes.

What happened instead? (Actual behavior)

There is always an unstaged file other_file.txt which case changes if
I try to discard and the unstaged change stays.
If I try to delete the file, I get two unstaged file removal changes.

What's different between what you expected and what actually happened?

The state should be clean. It looks like the merge process broke
something due to the casing.

Anything else you want to add:

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.28.0.windows.1
cpu: x86_64
built from commit: 77982caf269b7ee713a76da2bcf260c34d3bf7a7
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
uname: Windows 10.0 18363
compiler info: gnuc: 10.2
libc info: no libc information available
$SHELL (typically, interactive shell): <unset>

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

* Re: Repo state broken due to mismatched file name casing during merge
  2020-09-02 16:26 Repo state broken due to mismatched file name casing during merge Rafał Grzybowski
@ 2020-09-02 23:23 ` brian m. carlson
  2020-09-03  6:20   ` Rafał Grzybowski
  0 siblings, 1 reply; 3+ messages in thread
From: brian m. carlson @ 2020-09-02 23:23 UTC (permalink / raw)
  To: Rafał Grzybowski; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 1815 bytes --]

On 2020-09-02 at 16:26:27, Rafał Grzybowski wrote:
> What did you do before the bug happened? (Steps to reproduce your issue)
> 
> mkdir repo
> cd repo
> 
> git init
> 
> "sample file" > file.txt
> git add file.txt
> git commit -m "Added file.txt"
> 
> 
> git checkout -b other_branch
> echo other file > other_file.txt
> git add other_file.txt
> git commit -m "Added other_file.txt"
> 
> git checkout master
> echo Other file > Other_file.txt
> git add Other_file.txt
> git commit -m "Added Other_file.txt"
> 
> git merge other_branch
> git status
> 
> What did you expect to happen? (Expected behavior)
> 
> A clean state, no unstaged changes.
> 
> What happened instead? (Actual behavior)
> 
> There is always an unstaged file other_file.txt which case changes if
> I try to discard and the unstaged change stays.
> If I try to delete the file, I get two unstaged file removal changes.

Git always preserves the case of files internally.  However, the default
configuration on Windows does not.  When you performed this merge, you
ended up with two files, but it's not possible to write both of them
into the working tree.  Since they are not the same, when Git checks the
status of one of the files, it finds it to be modified.

The solution here is to do "git rm --cached Other_file.txt" followed by
a commit.  That removes the file from the index but doesn't touch the
working tree.  In Windows 10, you can also set a directory to be case
sensitive, which should fix this if you do a "git checkout .".

This isn't a bug in Git; Git doesn't know about file name encodings, and
even if it only handled Unicode file names, it's impossible to correctly
perform locale-insensitive case folding, so Git doesn't even try.
-- 
brian m. carlson: Houston, Texas, US

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

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

* Re: Repo state broken due to mismatched file name casing during merge
  2020-09-02 23:23 ` brian m. carlson
@ 2020-09-03  6:20   ` Rafał Grzybowski
  0 siblings, 0 replies; 3+ messages in thread
From: Rafał Grzybowski @ 2020-09-03  6:20 UTC (permalink / raw)
  To: brian m. carlson, Rafał Grzybowski, git

Ok, I understand the behaviour now.
Thank you for your help :)

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

end of thread, other threads:[~2020-09-03  6:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-02 16:26 Repo state broken due to mismatched file name casing during merge Rafał Grzybowski
2020-09-02 23:23 ` brian m. carlson
2020-09-03  6:20   ` Rafał Grzybowski

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.version-control.git
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.version-control.git
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git