Re: git diff does not precompose unicode file paths (OS X)

4 messages, 2 authors, 2016-06-16 · open the first message on its own page

Re: git diff does not precompose unicode file paths (OS X)

From: Torsten Bögershausen <hidden>
Date: 2016-06-15 23:08:39

quoted
And if not, I can put it on my TODO-stack.
I have read through the official contribution guidelines and I think I can
send an official patch.

In this case, would you prefer to have a single commit since the change
is related? Or would you prefer keeping it in separate commits, since
they are different commands and I can use commit subjects like “diff:”
and “diff-index:”, etc.?
Thanks for the work.
The same issue fixed at different places:
I personally would prefer a single commit.

Another thing is, if we want to add TC in t3910,
to avoid future regressions.
(Otherwise I can help with those)

Re: git diff does not precompose unicode file paths (OS X)

From: Alexander Rinass <hidden>
Date: 2016-06-15 23:08:44

On 08 Mar 2016, at 13:30, Torsten Bögershausen [off-list ref] wrote:
quoted
quoted
And if not, I can put it on my TODO-stack.
I have read through the official contribution guidelines and I think I can
send an official patch.

In this case, would you prefer to have a single commit since the change
is related? Or would you prefer keeping it in separate commits, since
they are different commands and I can use commit subjects like “diff:”
and “diff-index:”, etc.?
Thanks for the work.
The same issue fixed at different places:
I personally would prefer a single commit.

Another thing is, if we want to add TC in t3910,
to avoid future regressions.
(Otherwise I can help with those)
I created a test case but git diff exits with 0 if it does not recognize the file 
path so the test case always succeeds. Can you give me a hint or one 
example test case?

Re: git diff does not precompose unicode file paths (OS X)

From: Torsten Bögershausen <hidden>
Date: 2016-06-15 23:08:44

 >I created a test case but git diff exits with 0 if it does not recognize the 
file >path so the test case always succeeds. Can you give me a hint or one 
 >example test case?

The most clean (?) is to compare "git diff" NFC and git diff NFD, they should 
give the same result:
for "git diff" something like this would do:
+
+# This will test git diff
+test_expect_success "git diff f.Adiar" '
+       echo "Modified" >f.$Adiarnfd &&
+       git diff f.$Adiarnfd >expect &&
+       git diff f.$Adiarnfc >actual &&
+       git checkout f.$Adiarnfd &&
+       test_cmp expect actual
+'

HTH
/Torsten

Re: git diff does not precompose unicode file paths (OS X)

From: Alexander Rinass <hidden>
Date: 2016-06-16 02:18:39

On 15 Mar 2016, at 06:45, Torsten Bögershausen [off-list ref] wrote:
quoted
I created a test case but git diff exits with 0 if it does not recognize the file >path so the test case always succeeds. Can you give me a hint or one >example test case?
The most clean (?) is to compare "git diff" NFC and git diff NFD, they should give the same result:
for "git diff" something like this would do:
+
+# This will test git diff
+test_expect_success "git diff f.Adiar" '
+       echo "Modified" >f.$Adiarnfd &&
+       git diff f.$Adiarnfd >expect &&
+       git diff f.$Adiarnfc >actual &&
+       git checkout f.$Adiarnfd &&
+       test_cmp expect actual
+’
Thank you!

I had to tweak it a little but it now reproduces the issue and confirms the fix
for diff, diff-index, diff-files and diff-tree.

I have just sent in the full patch.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help