Skip to content

Commit a601d06

Browse files
committed
rn-42: add article about clone and icase
1 parent a931728 commit a601d06

File tree

1 file changed

+66
-2
lines changed

1 file changed

+66
-2
lines changed

‎rev_news/drafts/edition-42.md‎

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,73 @@ This edition covers what happened during the month of July 2018.
2525
### Reviews
2626
-->
2727

28-
<!---
2928
### Support
30-
-->
29+
30+
*[Git clone and case sensitivity](https://public-inbox.org/git/[email protected]/)
31+
32+
Paweł Paruzel reported that he found some test files in his repo
33+
appeared modified just after a clone because he had files like
34+
"boolStyle_t_f" and "boolStyle_T_F" that differ only in case and was
35+
cloning on a case-insensitive Mac.
36+
37+
He suggested having `git clone` throw an exception when files that
38+
differ only in case are cloned to a case insensitive system.
39+
40+
Brian Carlson replied that this would make it impossible to clone such
41+
a repository on a case-insensitive system while the current behavior
42+
might still result in a functional repo.
43+
44+
Brian also suggested using something like `test $(git status --porcelain | wc -l) -eq 0`
45+
to check that a repo is unmodified after clone.
46+
47+
Duy Nguyen agreed with Brian and proposed a patch that uses sparse
48+
checkout to hide all the paths that fail to checkout because of the
49+
filesystem. Duy's patch also warns to tell the user what happens.
50+
51+
Jeff King, alias Peff, replied to Duy suggesting just warning and
52+
advising the user. And Duy followed up with a modified patch that does
53+
just that.
54+
55+
Simon Ruderich commented that the advice message in Duy's patch should
56+
list the problematic file names to help users.
57+
58+
Peff agreed with Simon and wondered if it was better to detect at
59+
checkout time if a file already exists on the filesystem rather than
60+
checking before the checkout. Peff also noted that Duy's patch used
61+
strcasecmp() to check if filemanes diff only by case, but in some
62+
cases, especially related to utf8 names, a filesystem could use
63+
complex folding rules which we would need to follow.
64+
65+
Brian replied to Peff saying that it was indeed possible to detect the
66+
issue at checkout time, and Duy replied that it was actually what his
67+
patch was doing.
68+
69+
Duy, Peff and Jeff Hostetler then agreed that it would be difficult to
70+
follow complex folding rules that a filesystem might use.
71+
72+
Duy then started sending [a real patch in its own email](https://public-inbox.org/git/[email protected]/).
73+
74+
Junio Hamano chimed in to suggest a different implementation and a
75+
long discussion thread followed about how to best find all the
76+
colliding paths.
77+
78+
Duy sent [a version 2 of his patch](https://public-inbox.org/git/[email protected]/).
79+
80+
The previous long discussion thread continued following this patch though.
81+
82+
Duy sent [a version 3](https://public-inbox.org/git/[email protected]/)
83+
that actually tries to find all the colliding paths on "UNIXy platforms"
84+
and then [a version 4](https://public-inbox.org/git/[email protected]/).
85+
86+
A discussion and a patch about clarifying the documentation of the
87+
`core.checkStat` config option followed.
88+
89+
Duy then recently sent [a version 5](https://public-inbox.org/git/[email protected]/)
90+
which tries to find all the colliding paths on Windows too,
91+
and [a version 6](https://public-inbox.org/git/[email protected]/)
92+
to address a few more comments.
93+
94+
It looks like the latest version will be merged to the "next" branch soon.
3195

3296
<!---
3397
## Developer Spotlight:

0 commit comments

Comments
(0)