You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Teach Git to warn about name collisions on case-insensitive filesystems #365
Consider the following on a case-insensitive filesystem:
git init
echo a >a
git add a
git commit -m 'a'
git checkout --orphan=b
git mv a A
echo A >A
git add A
git commit -m 'A'
git merge --allow-unrelated-histories master
# this will show up as one of the files changed
git diff
git status
In the above, Git simply reports that one of the two files has changed, but perhaps we could do something like this:
$ git status
On branch b
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: A (filename collides with 'a')
no changes added to commit (use "git add" and/or "git commit -a")
and
$ git diff
file 'A' collides with 'a'
diff --git a/A b/A
index f70f10e..7898192 100644
--- a/A
+++ b/A
@@ -1 +1 @@
-A
+a
or something like that? Either way, we shouldn't be blindly ignoring the fact that a collision has happened but we should warn users explicitly so that they're aware.
As a side note, unpack_trees() has code to warn about name-collisions so that if you check out a different branch with one you'll get a warning. merge-ort reuses that code, so when we switch over to it, you should get the same warning at merge time.
However, it may make sense to also have git-status provide some kind of warning, just thought I'd note that there should soon be some kind of warning assuming people watch all the informational messages printed out at merge time.
Activity
newren commentedon Mar 10, 2020
As a side note, unpack_trees() has code to warn about name-collisions so that if you check out a different branch with one you'll get a warning. merge-ort reuses that code, so when we switch over to it, you should get the same warning at merge time.
However, it may make sense to also have git-status provide some kind of warning, just thought I'd note that there should soon be some kind of warning assuming people watch all the informational messages printed out at merge time.