{"thread":{"id":"41607","subject":"git diff does not precompose unicode file paths (OS X)","startedAt":"2016-03-04T09:07:48Z","lastAt":"2016-04-04T20:43:32Z","messageCount":11,"participants":["Alexander Rinass","Torsten Bögershausen","Junio C Hamano","Ramsay Jones"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"280177","messageId":"0008C25D-C3F0-4A1F-8B50-4EF1E84CA04F@fournova.com","threadId":"41607","inReplyTo":null,"subject":"git diff does not precompose unicode file paths (OS X)","fromName":"Alexander Rinass","fromEmail":"alex@fournova.com","sentAt":"2016-03-04T09:07:48Z","receivedAt":"2016-03-04T09:07:48Z","isPatch":false,"sender":{"key":"alex@fournova.com","avatar":"https://avatars.githubusercontent.com/u/116053?v=4"},"body":"Hallo,\n\nIt appears that the git diff command does not precompose file path arguments, even if the option core.precomposeunicode is set to true (which is the default on OS X).\n\nPassing the decomposed form of a file path to the git diff command will yield no diff for a modified file.\n\nIn my case, the decomposed form of the file path is sent by the OS X Cocoa framework's NSTask, wich I am using in an application. It can be simulated on OS X by using $(iconv -f utf-8 -t utf-8-mac <<< FILE_PATH) as file path argument on the shell.\n\nGit commands like add, log, ls-tree, ls-files, mv, ... accept both file path forms, git diff does not. \n\nIt can be tested with the following setup on OS X (as iconv's utf-8-mac encoding is only available on OS X):\n\n    git init .\n    git config core.quotepath true\n    git config core.precomposeunicode true # (default on OS X)\n    touch .gitignore && git add .gitignore && git commit -m \"Initial commit\"\n    \n    echo \".\" >> Ä\n    git add Ä\n    git commit -m \"Create commit with unicode file path\"\n    \n    echo \".\" >> Ä\n    \nThis gives the following status, showing the precomposed form of \"Ä\":\n\n    git status --short\n     M \"\\303\\204\"\n    \nRunning git add with both forms does work as expected:\n\n    git add Ä\n    git status --short\n    M  \"\\303\\204\"\n    \n    git reset HEAD -- Ä\n    \n    git add $(iconv -f utf-8 -t utf-8-mac <<< Ä)\n    git status --short\n    M  \"\\303\\204\"\n    \n    git reset HEAD -- Ä\n    \nHowever, running git diff only works with the precomposed form:\n\n    git status --short\n     M \"\\303\\204\"\n    \n    git --no-pager diff -- Ä\n    [...shows diff...]\n    \n    git --no-pager diff -- $(iconv -f utf-8 -t utf-8-mac <<< Ä)\n    [...shows NO diff...]\n\nI took a look at the Git source code, and the builtin/diff*.c do not contain the parse_options call (which does the precompose_argv call) that the other builtins use.\n\nBut I am not really familiar with either C or the Git project structure, so this may not mean anything. \n\nBest regards,\nAlexander Rinass\n"},{"id":"280188","messageId":"56D97C8C.1060205@web.de","threadId":"41607","inReplyTo":"0008C25D-C3F0-4A1F-8B50-4EF1E84CA04F@fournova.com","subject":"Re: git diff does not precompose unicode file paths (OS X)","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-03-04T12:16:12Z","receivedAt":"2016-03-04T12:16:12Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 03/04/2016 10:07 AM, Alexander Rinass wrote:\n> Hallo,\n>\n> It appears that the git diff command does not precompose file path arguments, even if the option core.precomposeunicode is set to true (which is the default on OS X).\n>\n> Passing the decomposed form of a file path to the git diff command will yield no diff for a modified file.\n>\n> In my case, the decomposed form of the file path is sent by the OS X Cocoa framework's NSTask, wich I am using in an application. It can be simulated on OS X by using $(iconv -f utf-8 -t utf-8-mac <<< FILE_PATH) as file path argument on the shell.\n>\n> Git commands like add, log, ls-tree, ls-files, mv, ... accept both file path forms, git diff does not.\n>\n> It can be tested with the following setup on OS X (as iconv's utf-8-mac encoding is only available on OS X):\n>\n>      git init .\n>      git config core.quotepath true\n>      git config core.precomposeunicode true # (default on OS X)\n>      touch .gitignore && git add .gitignore && git commit -m \"Initial commit\"\n>      \n>      echo \".\" >> Ä\n>      git add Ä\n>      git commit -m \"Create commit with unicode file path\"\n>      \n>      echo \".\" >> Ä\n>      \n> This gives the following status, showing the precomposed form of \"Ä\":\n>\n>      git status --short\n>       M \"\\303\\204\"\n>      \n> Running git add with both forms does work as expected:\n>\n>      git add Ä\n>      git status --short\n>      M  \"\\303\\204\"\n>      \n>      git reset HEAD -- Ä\n>      \n>      git add $(iconv -f utf-8 -t utf-8-mac <<< Ä)\n>      git status --short\n>      M  \"\\303\\204\"\n>      \n>      git reset HEAD -- Ä\n>      \n> However, running git diff only works with the precomposed form:\n>\n>      git status --short\n>       M \"\\303\\204\"\n>      \n>      git --no-pager diff -- Ä\n>      [...shows diff...]\n>      \n>      git --no-pager diff -- $(iconv -f utf-8 -t utf-8-mac <<< Ä)\n>      [...shows NO diff...]\n>\n> I took a look at the Git source code, and the builtin/diff*.c do not contain the parse_options call (which does the precompose_argv call) that the other builtins use.\n>\n> But I am not really familiar with either C or the Git project structure, so this may not mean anything.\n>\n> Best regards,\n> Alexander Rinass\n>\nGood analyzes, and thanks for the report.\nIt should be possible to stick in a\n\nprecompose_arrgv(argc, argv)\n\ninto builtin/diff.c\n\nDo you you can test that ?\n"},{"id":"280194","messageId":"D9E0FEEC-1987-4045-AD0F-4C7C76DC067B@fournova.com","threadId":"41607","inReplyTo":"56D97C8C.1060205@web.de","subject":"Re: git diff does not precompose unicode file paths (OS X)","fromName":"Alexander Rinass","fromEmail":"alex@fournova.com","sentAt":"2016-03-04T14:37:05Z","receivedAt":"2016-03-04T14:37:05Z","isPatch":false,"sender":{"key":"alex@fournova.com","avatar":"https://avatars.githubusercontent.com/u/116053?v=4"},"body":"\n> On 04 Mar 2016, at 13:16, Torsten Bögershausen <tboegi@web.de> wrote:\n> \n> On 03/04/2016 10:07 AM, Alexander Rinass wrote:\n>> Hallo,\n>> \n>> It appears that the git diff command does not precompose file path arguments, even if the option core.precomposeunicode is set to true (which is the default on OS X).\n>> \n>> Passing the decomposed form of a file path to the git diff command will yield no diff for a modified file.\n>> \n>> In my case, the decomposed form of the file path is sent by the OS X Cocoa framework's NSTask, wich I am using in an application. It can be simulated on OS X by using $(iconv -f utf-8 -t utf-8-mac <<< FILE_PATH) as file path argument on the shell.\n>> \n>> Git commands like add, log, ls-tree, ls-files, mv, ... accept both file path forms, git diff does not.\n>> \n>> It can be tested with the following setup on OS X (as iconv's utf-8-mac encoding is only available on OS X):\n>> \n>>     git init .\n>>     git config core.quotepath true\n>>     git config core.precomposeunicode true # (default on OS X)\n>>     touch .gitignore && git add .gitignore && git commit -m \"Initial commit\"\n>>          echo \".\" >> Ä\n>>     git add Ä\n>>     git commit -m \"Create commit with unicode file path\"\n>>          echo \".\" >> Ä\n>>     This gives the following status, showing the precomposed form of \"Ä\":\n>> \n>>     git status --short\n>>      M \"\\303\\204\"\n>>     Running git add with both forms does work as expected:\n>> \n>>     git add Ä\n>>     git status --short\n>>     M  \"\\303\\204\"\n>>          git reset HEAD -- Ä\n>>          git add $(iconv -f utf-8 -t utf-8-mac <<< Ä)\n>>     git status --short\n>>     M  \"\\303\\204\"\n>>          git reset HEAD -- Ä\n>>     However, running git diff only works with the precomposed form:\n>> \n>>     git status --short\n>>      M \"\\303\\204\"\n>>          git --no-pager diff -- Ä\n>>     [...shows diff...]\n>>          git --no-pager diff -- $(iconv -f utf-8 -t utf-8-mac <<< Ä)\n>>     [...shows NO diff...]\n>> \n>> I took a look at the Git source code, and the builtin/diff*.c do not contain the parse_options call (which does the precompose_argv call) that the other builtins use.\n>> \n>> But I am not really familiar with either C or the Git project structure, so this may not mean anything.\n>> \n>> Best regards,\n>> Alexander Rinass\n>> \n> Good analyzes, and thanks for the report.\n> It should be possible to stick in a\n> \n> precompose_arrgv(argc, argv)\n> \n> into builtin/diff.c\n> \n> Do you you can test that ?\n> \n\n\nSticking a precompose_argv(argc, argv) into diff.c’s cmd_diff function fixes the issue.\n\nBut I had to disable the check (precomposed_unicode != 1) in precompose_argv to make it work. That’s probably because precompose_argv is usually called from parse_options and is missing some other call before it?\n\nI think it is clear that diff.c and friends are definitely missing the precomposing step. I am not sure about the right way to fix though (should parse_options be used in the end?) and my C skills are basic at best, otherwise I would create a patch.\n"},{"id":"280202","messageId":"xmqqsi06yts3.fsf@gitster.mtv.corp.google.com","threadId":"41607","inReplyTo":"D9E0FEEC-1987-4045-AD0F-4C7C76DC067B@fournova.com","subject":"Re: git diff does not precompose unicode file paths (OS X)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-04T18:36:44Z","receivedAt":"2016-03-04T18:36:44Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alexander Rinass <alex@fournova.com> writes:\n\n> Sticking a precompose_argv(argc, argv) into diff.c’s cmd_diff\n> function fixes the issue.\n>\n> But I had to disable the check (precomposed_unicode != 1) in\n> precompose_argv to make it work. That’s probably because\n> precompose_argv is usually called from parse_options and is\n> missing some other call before it?\n\nThe \"precomposed_unicode\" bit comes from your configuration file,\nso it won't be usable before you call into git_default_core_config\nand that happens via a call to \"git_config(git_diff_ui_config, NULL)\".\n\nSo perhaps you'd want to add the argv munging immediately before\ninit_revisions() call there?\n"},{"id":"280207","messageId":"56D9D8C6.2060104@ramsayjones.plus.com","threadId":"41607","inReplyTo":"D9E0FEEC-1987-4045-AD0F-4C7C76DC067B@fournova.com","subject":"Re: git diff does not precompose unicode file paths (OS X)","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2016-03-04T18:49:42Z","receivedAt":"2016-03-04T18:49:42Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 04/03/16 14:37, Alexander Rinass wrote:\n> \n>> On 04 Mar 2016, at 13:16, Torsten Bögershausen <tboegi@web.de> wrote:\n>>\n>> On 03/04/2016 10:07 AM, Alexander Rinass wrote:\n[snip]\n\n> \n> Sticking a precompose_argv(argc, argv) into diff.c’s cmd_diff function fixes the issue.\n> \n> But I had to disable the check (precomposed_unicode != 1) in precompose_argv to make it work. That’s probably because precompose_argv is usually called from parse_options and is missing some other call before it?\n> \n\nYes, you need to place it after the configuration is read, but before\ncalls to diff_no_index() or setup_revisions(). Directly after the call\nto git_config() should be fine. [But this begs the question about other\ncommands, including plumbing, which don't call parse_options().]\n\nMaybe this will work for you (I can't test it, since I don't have any\naccess to a Mac):\n\ndiff --git a/builtin/diff.c b/builtin/diff.c\nindex 343c6b8..b7a9405 100644\n--- a/builtin/diff.c\n+++ b/builtin/diff.c\n@@ -320,6 +320,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)\n \t\tgitmodules_config();\n \tinit_diff_ui_defaults();\n \tgit_config(git_diff_ui_config, NULL);\n+\tprecompose_argv(argc, argv);\n \n \tinit_revisions(&rev, prefix);\n \n\n\nATB,\nRamsay Jones\n"},{"id":"280316","messageId":"8C785DB2-CEDB-435B-945B-00E4D98DBF99@fournova.com","threadId":"41607","inReplyTo":"56D9D8C6.2060104@ramsayjones.plus.com","subject":"Re: git diff does not precompose unicode file paths (OS X)","fromName":"Alexander Rinass","fromEmail":"alex@fournova.com","sentAt":"2016-03-07T07:47:47Z","receivedAt":"2016-03-07T07:47:47Z","isPatch":false,"sender":{"key":"alex@fournova.com","avatar":"https://avatars.githubusercontent.com/u/116053?v=4"},"body":"\n> On 04 Mar 2016, at 19:49, Ramsay Jones <ramsay@ramsayjones.plus.com> wrote:\n> \n> \n> \n> On 04/03/16 14:37, Alexander Rinass wrote:\n>> \n>>> On 04 Mar 2016, at 13:16, Torsten Bögershausen <tboegi@web.de> wrote:\n>>> \n>>> On 03/04/2016 10:07 AM, Alexander Rinass wrote:\n> [snip]\n> \n>> \n>> Sticking a precompose_argv(argc, argv) into diff.c’s cmd_diff function fixes the issue.\n>> \n>> But I had to disable the check (precomposed_unicode != 1) in precompose_argv to make it work. That’s probably because precompose_argv is usually called from parse_options and is missing some other call before it?\n>> \n> \n> Yes, you need to place it after the configuration is read, but before\n> calls to diff_no_index() or setup_revisions(). Directly after the call\n> to git_config() should be fine. [But this begs the question about other\n> commands, including plumbing, which don't call parse_options().]\n> \n> Maybe this will work for you (I can't test it, since I don't have any\n> access to a Mac):\n> \n> diff --git a/builtin/diff.c b/builtin/diff.c\n> index 343c6b8..b7a9405 100644\n> --- a/builtin/diff.c\n> +++ b/builtin/diff.c\n> @@ -320,6 +320,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)\n> \t\tgitmodules_config();\n> \tinit_diff_ui_defaults();\n> \tgit_config(git_diff_ui_config, NULL);\n> +\tprecompose_argv(argc, argv);\n> \n> \tinit_revisions(&rev, prefix);\n\nYour patch fixes it for the diff command without further modifications.\n\nI have also modified diff-tree, diff-index and diff-files by adding the precompose_argv call and successfully verified it.\n\nI have attached the full patch. If there is anything else I can test, let me know.\n\ndiff --git a/builtin/diff-files.c b/builtin/diff-files.c\nindex 8ed2eb8..15c61fd 100644\n--- a/builtin/diff-files.c\n+++ b/builtin/diff-files.c\n@@ -24,6 +24,7 @@ int cmd_diff_files(int argc, const char **argv, const char *prefix)\n \tgitmodules_config();\n \tgit_config(git_diff_basic_config, NULL); /* no \"diff\" UI options */\n \trev.abbrev = 0;\n+\tprecompose_argv(argc, argv);\n \n \targc = setup_revisions(argc, argv, &rev, NULL);\n \twhile (1 < argc && argv[1][0] == '-') {\ndiff --git a/builtin/diff-index.c b/builtin/diff-index.c\nindex d979824..1af373d 100644\n--- a/builtin/diff-index.c\n+++ b/builtin/diff-index.c\n@@ -21,6 +21,7 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix)\n \tgitmodules_config();\n \tgit_config(git_diff_basic_config, NULL); /* no \"diff\" UI options */\n \trev.abbrev = 0;\n+\tprecompose_argv(argc, argv);\n \n \targc = setup_revisions(argc, argv, &rev, NULL);\n \tfor (i = 1; i < argc; i++) {\ndiff --git a/builtin/diff-tree.c b/builtin/diff-tree.c\nindex 2a12b81..806dd7a 100644\n--- a/builtin/diff-tree.c\n+++ b/builtin/diff-tree.c\n@@ -114,6 +114,8 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)\n \topt->disable_stdin = 1;\n \tmemset(&s_r_opt, 0, sizeof(s_r_opt));\n \ts_r_opt.tweak = diff_tree_tweak_rev;\n+\n+\tprecompose_argv(argc, argv);\n \targc = setup_revisions(argc, argv, opt, &s_r_opt);\n \n \twhile (--argc > 0) {\ndiff --git a/builtin/diff.c b/builtin/diff.c\nindex 52c98a9..d6b8f98 100644\n--- a/builtin/diff.c\n+++ b/builtin/diff.c\n@@ -319,6 +319,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)\n \tif (!no_index)\n \t\tgitmodules_config();\n \tgit_config(git_diff_ui_config, NULL);\n+\tprecompose_argv(argc, argv);\n \n \tinit_revisions(&rev, prefix);\n \n"},{"id":"280320","messageId":"56DD41D5.60100@web.de","threadId":"41607","inReplyTo":"8C785DB2-CEDB-435B-945B-00E4D98DBF99@fournova.com","subject":"Re: git diff does not precompose unicode file paths (OS X)","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-03-07T08:54:45Z","receivedAt":"2016-03-07T08:54:45Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 03/07/2016 08:47 AM, Alexander Rinass wrote:\n>> On 04 Mar 2016, at 19:49, Ramsay Jones <ramsay@ramsayjones.plus.com> wrote:\n>>\n>>\n>>\n>> On 04/03/16 14:37, Alexander Rinass wrote:\n>>>> On 04 Mar 2016, at 13:16, Torsten Bögershausen <tboegi@web.de> wrote:\n>>>>\n>>>> On 03/04/2016 10:07 AM, Alexander Rinass wrote:\n>> [snip]\n>>\n>>> Sticking a precompose_argv(argc, argv) into diff.c’s cmd_diff function fixes the issue.\n>>>\n>>> But I had to disable the check (precomposed_unicode != 1) in precompose_argv to make it work. That’s probably because precompose_argv is usually called from parse_options and is missing some other call before it?\n>>>\n>> Yes, you need to place it after the configuration is read, but before\n>> calls to diff_no_index() or setup_revisions(). Directly after the call\n>> to git_config() should be fine. [But this begs the question about other\n>> commands, including plumbing, which don't call parse_options().]\n>>\n>> Maybe this will work for you (I can't test it, since I don't have any\n>> access to a Mac):\n>>\n>> diff --git a/builtin/diff.c b/builtin/diff.c\n>> index 343c6b8..b7a9405 100644\n>> --- a/builtin/diff.c\n>> +++ b/builtin/diff.c\n>> @@ -320,6 +320,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)\n>> \t\tgitmodules_config();\n>> \tinit_diff_ui_defaults();\n>> \tgit_config(git_diff_ui_config, NULL);\n>> +\tprecompose_argv(argc, argv);\n>>\n>> \tinit_revisions(&rev, prefix);\n> Your patch fixes it for the diff command without further modifications.\n>\n> I have also modified diff-tree, diff-index and diff-files by adding the precompose_argv call and successfully verified it.\n>\n> I have attached the full patch. If there is anything else I can test, let me know.\nThanks for reporting, fixing, testing -\nDo you think you can send an official patch to the list ?\nIf not, push your patches to some public repo ?\nAnd if not, I can put it on my TODO-stack.\n"},{"id":"280364","messageId":"56DEC5DD.2070407@web.de","threadId":"41607","inReplyTo":"5C6A30EF-ED0A-4D64-B971-CF873C64B46E@fournova.com","subject":"Re: git diff does not precompose unicode file paths (OS X)","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-03-08T12:30:21Z","receivedAt":"2016-03-08T12:30:21Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":">> And if not, I can put it on my TODO-stack.\n> I have read through the official contribution guidelines and I think I can\n> send an official patch.\n>\n> In this case, would you prefer to have a single commit since the change\n> is related? Or would you prefer keeping it in separate commits, since\n> they are different commands and I can use commit subjects like “diff:”\n> and “diff-index:”, etc.?\n>\nThanks for the work.\nThe same issue fixed at different places:\nI personally would prefer a single commit.\n\nAnother thing is, if we want to add TC in t3910,\nto avoid future regressions.\n(Otherwise I can help with those)\n"},{"id":"280748","messageId":"A81BB0E5-4879-4A86-9019-BB76734BA9EF@fournova.com","threadId":"41607","inReplyTo":"56DEC5DD.2070407@web.de","subject":"Re: git diff does not precompose unicode file paths (OS X)","fromName":"Alexander Rinass","fromEmail":"alex@fournova.com","sentAt":"2016-03-14T21:45:43Z","receivedAt":"2016-03-14T21:45:43Z","isPatch":false,"sender":{"key":"alex@fournova.com","avatar":"https://avatars.githubusercontent.com/u/116053?v=4"},"body":"\n> On 08 Mar 2016, at 13:30, Torsten Bögershausen <tboegi@web.de> wrote:\n> \n>>> And if not, I can put it on my TODO-stack.\n>> I have read through the official contribution guidelines and I think I can\n>> send an official patch.\n>> \n>> In this case, would you prefer to have a single commit since the change\n>> is related? Or would you prefer keeping it in separate commits, since\n>> they are different commands and I can use commit subjects like “diff:”\n>> and “diff-index:”, etc.?\n>> \n> Thanks for the work.\n> The same issue fixed at different places:\n> I personally would prefer a single commit.\n> \n> Another thing is, if we want to add TC in t3910,\n> to avoid future regressions.\n> (Otherwise I can help with those)\n\nI created a test case but git diff exits with 0 if it does not recognize the file \npath so the test case always succeeds. Can you give me a hint or one \nexample test case?\n"},{"id":"280760","messageId":"56E7A191.7070302@web.de","threadId":"41607","inReplyTo":"A81BB0E5-4879-4A86-9019-BB76734BA9EF@fournova.com","subject":"Re: git diff does not precompose unicode file paths (OS X)","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-03-15T05:45:53Z","receivedAt":"2016-03-15T05:45:53Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":" >I created a test case but git diff exits with 0 if it does not recognize the \nfile >path so the test case always succeeds. Can you give me a hint or one \n >example test case?\n\nThe most clean (?) is to compare \"git diff\" NFC and git diff NFD, they should \ngive the same result:\nfor \"git diff\" something like this would do:\n+\n+# This will test git diff\n+test_expect_success \"git diff f.Adiar\" '\n+       echo \"Modified\" >f.$Adiarnfd &&\n+       git diff f.$Adiarnfd >expect &&\n+       git diff f.$Adiarnfc >actual &&\n+       git checkout f.$Adiarnfd &&\n+       test_cmp expect actual\n+'\n\nHTH\n/Torsten\n"},{"id":"282649","messageId":"9490B637-D3DD-45CC-B2D7-B471AD6B5956@fournova.com","threadId":"41607","inReplyTo":"56E7A191.7070302@web.de","subject":"Re: git diff does not precompose unicode file paths (OS X)","fromName":"Alexander Rinass","fromEmail":"alex@fournova.com","sentAt":"2016-04-04T20:43:32Z","receivedAt":"2016-04-04T20:43:32Z","isPatch":false,"sender":{"key":"alex@fournova.com","avatar":"https://avatars.githubusercontent.com/u/116053?v=4"},"body":"\n> On 15 Mar 2016, at 06:45, Torsten Bögershausen <tboegi@web.de> wrote:\n> \n> >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?\n> \n> The most clean (?) is to compare \"git diff\" NFC and git diff NFD, they should give the same result:\n> for \"git diff\" something like this would do:\n> +\n> +# This will test git diff\n> +test_expect_success \"git diff f.Adiar\" '\n> +       echo \"Modified\" >f.$Adiarnfd &&\n> +       git diff f.$Adiarnfd >expect &&\n> +       git diff f.$Adiarnfc >actual &&\n> +       git checkout f.$Adiarnfd &&\n> +       test_cmp expect actual\n> +’\n\nThank you!\n\nI had to tweak it a little but it now reproduces the issue and confirms the fix\nfor diff, diff-index, diff-files and diff-tree.\n\nI have just sent in the full patch.\n"}]}