{"thread":{"id":"40168","subject":"[PATCH v5] git-p4: Obey core.ignorecase when using P4 client specs.","startedAt":"2015-08-24T21:30:04Z","lastAt":"2015-08-26T10:18:37Z","messageCount":10,"participants":["larsxschneider@gmail.com","Luke Diamand","Lars Schneider","Torsten Bögershausen"],"isPatch":true,"patchVersion":5,"patchTotal":null},"messages":[{"id":"268608","messageId":"1440451805-85095-1-git-send-email-larsxschneider@gmail.com","threadId":"40168","inReplyTo":null,"subject":"[PATCH v5] git-p4: Obey core.ignorecase when using P4 client specs.","fromName":"","fromEmail":"larsxschneider@gmail.com","sentAt":"2015-08-24T21:30:04Z","receivedAt":"2015-08-24T21:30:04Z","isPatch":true,"sender":{"key":"larsxschneider@gmail.com","avatar":"https://avatars.githubusercontent.com/u/477434?v=4"},"body":"From: Lars Schneider <larsxschneider@gmail.com>\n\nThanks to Luke Diamand I realized the core problem and propose here a\nsubstiantially simpler fix to my PATCH v4.\n\nThe test cases remain and prove the problem. In particular\n\"8 - Clone path (ignorecase)\" and\n\"Add a new file and clone path with new file (ignorecase)\" fail with the\ncurrent implementation on OS X and Linux.\n\nLars Schneider (1):\n  git-p4: Obey core.ignorecase when using P4 client specs.\n\n git-p4.py                         |   7 ++\n t/t9821-git-p4-path-variations.sh | 200 ++++++++++++++++++++++++++++++++++++++\n 2 files changed, 207 insertions(+)\n create mode 100755 t/t9821-git-p4-path-variations.sh\n\n--\n1.9.5 (Apple Git-50.3)\n"},{"id":"268609","messageId":"1440451805-85095-2-git-send-email-larsxschneider@gmail.com","threadId":"40168","inReplyTo":"1440451805-85095-1-git-send-email-larsxschneider@gmail.com","subject":"[PATCH v5] git-p4: Obey core.ignorecase when using P4 client specs.","fromName":"","fromEmail":"larsxschneider@gmail.com","sentAt":"2015-08-24T21:30:05Z","receivedAt":"2015-08-24T21:30:05Z","isPatch":true,"sender":{"key":"larsxschneider@gmail.com","avatar":"https://avatars.githubusercontent.com/u/477434?v=4"},"body":"From: Lars Schneider <larsxschneider@gmail.com>\n\nWe run P4 servers on Linux and P4 clients on Windows. For an unknown\nreason the file path for a number of files in P4 does not match the\ndirectory path with respect to case sensitivity.\n\nE.g. \"p4 files\" might return\n//depot/path/to/file1\n//depot/pATH/to/file2\n\nIf you use P4/P4V then these files end up in the same directory, e.g.\n//depot/path/to/file1\n//depot/path/to/file2\n\nIf you use git-p4 and clone the code via client spec \"//depot/path/...\"\nthen all files not matching the case in the client spec will be ignored\n(in the example above \"file2\"). This is correct if core.ignorecase=false\nbut not otherwise.\n\nSigned-off-by: Lars Schneider <larsxschneider@gmail.com>\n---\n git-p4.py                         |   7 ++\n t/t9821-git-p4-path-variations.sh | 200 ++++++++++++++++++++++++++++++++++++++\n 2 files changed, 207 insertions(+)\n create mode 100755 t/t9821-git-p4-path-variations.sh\n\ndiff --git a/git-p4.py b/git-p4.py\nindex 073f87b..0093fa3 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -1950,10 +1950,14 @@ class View(object):\n             if \"unmap\" in res:\n                 # it will list all of them, but only one not unmap-ped\n                 continue\n+            if gitConfigBool(\"core.ignorecase\"):\n+                res['depotFile'] = res['depotFile'].lower()\n             self.client_spec_path_cache[res['depotFile']] = self.convert_client_path(res[\"clientFile\"])\n \n         # not found files or unmap files set to \"\"\n         for depotFile in fileArgs:\n+            if gitConfigBool(\"core.ignorecase\"):\n+                depotFile = depotFile.lower()\n             if depotFile not in self.client_spec_path_cache:\n                 self.client_spec_path_cache[depotFile] = \"\"\n \n@@ -1962,6 +1966,9 @@ class View(object):\n            depot file should live.  Returns \"\" if the file should\n            not be mapped in the client.\"\"\"\n \n+        if gitConfigBool(\"core.ignorecase\"):\n+            depot_path = depot_path.lower()\n+\n         if depot_path in self.client_spec_path_cache:\n             return self.client_spec_path_cache[depot_path]\n \ndiff --git a/t/t9821-git-p4-path-variations.sh b/t/t9821-git-p4-path-variations.sh\nnew file mode 100755\nindex 0000000..599d16c\n--- /dev/null\n+++ b/t/t9821-git-p4-path-variations.sh\n@@ -0,0 +1,200 @@\n+#!/bin/sh\n+\n+test_description='Clone repositories with path case variations'\n+\n+. ./lib-git-p4.sh\n+\n+test_expect_success 'start p4d with case folding enabled' '\n+\tstart_p4d -C1\n+'\n+\n+test_expect_success 'Create a repo with path case variations' '\n+\tclient_view \"//depot/... //client/...\" &&\n+\t(\n+\t\tcd \"$cli\" &&\n+\n+\t\tmkdir -p One/two &&\n+\t\t>One/two/File2.txt &&\n+\t\tp4 add One/two/File2.txt &&\n+\t\tp4 submit -d \"Add file2\" &&\n+\t\trm -rf One &&\n+\n+\t\tmkdir -p one/TWO &&\n+\t\t>one/TWO/file1.txt &&\n+\t\tp4 add one/TWO/file1.txt &&\n+\t\tp4 submit -d \"Add file1\" &&\n+\t\trm -rf one &&\n+\n+\t\tmkdir -p one/two &&\n+\t\t>one/two/file3.txt &&\n+\t\tp4 add one/two/file3.txt &&\n+\t\tp4 submit -d \"Add file3\" &&\n+\t\trm -rf one &&\n+\n+\t\tmkdir -p outside-spec &&\n+\t\t>outside-spec/file4.txt &&\n+\t\tp4 add outside-spec/file4.txt &&\n+\t\tp4 submit -d \"Add file4\" &&\n+\t\trm -rf outside-spec\n+\t)\n+'\n+\n+test_expect_success 'Clone root' '\n+\tclient_view \"//depot/... //client/...\" &&\n+\ttest_when_finished cleanup_git &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\tgit init . &&\n+\t\tgit config core.ignorecase false &&\n+\t\tgit p4 clone --use-client-spec --destination=\"$git\" //depot &&\n+\t\t# This method is used instead of \"test -f\" to ensure the case is\n+\t\t# checked even if the test is executed on case-insensitive file systems.\n+\t\t# All files are there as expected although the path cases look random.\n+\t\tcat >expect <<-\\EOF &&\n+\t\tOne/two/File2.txt\n+\t\tone/TWO/file1.txt\n+\t\tone/two/file3.txt\n+\t\toutside-spec/file4.txt\n+\t\tEOF\n+\t\tgit ls-files >actual &&\n+\t\ttest_cmp expect actual\n+\t)\n+'\n+\n+test_expect_success 'Clone root (ignorecase)' '\n+\tclient_view \"//depot/... //client/...\" &&\n+\ttest_when_finished cleanup_git &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\tgit init . &&\n+\t\tgit config core.ignorecase true &&\n+\t\tgit p4 clone --use-client-spec --destination=\"$git\" //depot &&\n+\t\t# This method is used instead of \"test -f\" to ensure the case is\n+\t\t# checked even if the test is executed on case-insensitive file systems.\n+\t\t# All files are there as expected although the path cases look random.\n+\t\tcat >expect <<-\\EOF &&\n+\t\tone/TWO/File2.txt\n+\t\tone/TWO/file1.txt\n+\t\tone/TWO/file3.txt\n+\t\toutside-spec/file4.txt\n+\t\tEOF\n+\t\tgit ls-files >actual &&\n+\t\ttest_cmp expect actual\n+\t)\n+'\n+\n+test_expect_success 'Clone root and ignore one file' '\n+\tclient_view \\\n+\t\t\"//depot/... //client/...\" \\\n+\t\t\"-//depot/one/TWO/file1.txt //client/one/TWO/file1.txt\" &&\n+\ttest_when_finished cleanup_git &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\tgit init . &&\n+\t\tgit config core.ignorecase false &&\n+\t\tgit p4 clone --use-client-spec --destination=\"$git\" //depot &&\n+\t\t# We ignore one file in the client spec and all path cases change from\n+\t\t# \"TWO\" to \"two\"!\n+\t\tcat >expect <<-\\EOF &&\n+\t\tOne/two/File2.txt\n+\t\tone/two/file3.txt\n+\t\toutside-spec/file4.txt\n+\t\tEOF\n+\t\tgit ls-files >actual &&\n+\t\ttest_cmp expect actual\n+\t)\n+'\n+\n+test_expect_success 'Clone root and ignore one file (ignorecase)' '\n+\tclient_view \\\n+\t\t\"//depot/... //client/...\" \\\n+\t\t\"-//depot/one/TWO/file1.txt //client/one/TWO/file1.txt\" &&\n+\ttest_when_finished cleanup_git &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\tgit init . &&\n+\t\tgit config core.ignorecase true &&\n+\t\tgit p4 clone --use-client-spec --destination=\"$git\" //depot &&\n+\t\t# We ignore one file in the client spec and all path cases change from\n+\t\t# \"TWO\" to \"two\"!\n+\t\tcat >expect <<-\\EOF &&\n+\t\tOne/two/File2.txt\n+\t\tOne/two/file3.txt\n+\t\toutside-spec/file4.txt\n+\t\tEOF\n+\t\tgit ls-files >actual &&\n+\t\ttest_cmp expect actual\n+\t)\n+'\n+\n+test_expect_success 'Clone path' '\n+\tclient_view \"//depot/One/... //client/...\" &&\n+\ttest_when_finished cleanup_git &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\tgit init . &&\n+\t\tgit config core.ignorecase false &&\n+\t\tgit p4 clone --use-client-spec --destination=\"$git\" //depot &&\n+\t\tcat >expect <<-\\EOF &&\n+\t\ttwo/File2.txt\n+\t\tEOF\n+\t\tgit ls-files >actual &&\n+\t\ttest_cmp expect actual\n+\t)\n+'\n+\n+test_expect_success 'Clone path (ignorecase)' '\n+\tclient_view \"//depot/One/... //client/...\" &&\n+\ttest_when_finished cleanup_git &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\tgit init . &&\n+\t\tgit config core.ignorecase true &&\n+\t\tgit p4 clone --use-client-spec --destination=\"$git\" //depot &&\n+\t\tcat >expect <<-\\EOF &&\n+\t\tTWO/File2.txt\n+\t\tTWO/file1.txt\n+\t\tTWO/file3.txt\n+\t\tEOF\n+\t\tgit ls-files >actual &&\n+\t\ttest_cmp expect actual\n+\t)\n+'\n+\n+# It looks like P4 determines the path case based on the first file in\n+# lexicographical order. Please note the lower case \"two\" directory for all\n+# files triggered through the addition of \"File0.txt\".\n+test_expect_success 'Add a new file and clone path with new file (ignorecase)' '\n+\tclient_view \"//depot/... //client/...\" &&\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\tmkdir -p One/two &&\n+\t\t>One/two/File0.txt &&\n+\t\tp4 add One/two/File0.txt &&\n+\t\tp4 submit -d \"Add file\" &&\n+\t\trm -rf One\n+\t) &&\n+\n+\tclient_view \"//depot/One/... //client/...\" &&\n+\ttest_when_finished cleanup_git &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\tgit init . &&\n+\t\tgit config core.ignorecase true &&\n+\t\tgit p4 clone --use-client-spec --destination=\"$git\" //depot &&\n+\t\tcat >expect <<-\\EOF &&\n+\t\ttwo/File0.txt\n+\t\ttwo/File2.txt\n+\t\ttwo/file1.txt\n+\t\ttwo/file3.txt\n+\t\tEOF\n+\t\tgit ls-files >actual &&\n+\t\ttest_cmp expect actual\n+\t)\n+'\n+\n+test_expect_success 'kill p4d' '\n+\tkill_p4d\n+'\n+\n+test_done\n-- \n1.9.5 (Apple Git-50.3)\n"},{"id":"268628","messageId":"55DC111A.6090501@diamand.org","threadId":"40168","inReplyTo":"1440451805-85095-1-git-send-email-larsxschneider@gmail.com","subject":"Re: [PATCH v5] git-p4: Obey core.ignorecase when using P4 client specs.","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-08-25T06:54:18Z","receivedAt":"2015-08-25T06:54:18Z","isPatch":true,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 24/08/15 22:30, larsxschneider@gmail.com wrote:\n> From: Lars Schneider <larsxschneider@gmail.com>\n>\n> Thanks to Luke Diamand I realized the core problem and propose here a\n> substiantially simpler fix to my PATCH v4.\n>\n> The test cases remain and prove the problem. In particular\n> \"8 - Clone path (ignorecase)\" and\n> \"Add a new file and clone path with new file (ignorecase)\" fail with the\n> current implementation on OS X and Linux.\n\nThat's a lot simpler, thanks!\n\nCould we give this its own command line option and git config variable?\n\nCore.ignorecase gets set if the client is on a filing system that \nignores case. This is slightly different - it squashes case in depot \nfiles for people with depots that have incorrectly jumbled-up case.\n\nConflating the two seems like it would cause confusion at some point - \nfor example, I have no idea how the rest of git behaves if \ncore.ignorecase is set to True on a case-preserving file system.\n\nIt would probably be necessary to change p4PathStartsWith() to also \ncheck the same flag.\n\n\n>\n> Lars Schneider (1):\n>    git-p4: Obey core.ignorecase when using P4 client specs.\n>\n>   git-p4.py                         |   7 ++\n>   t/t9821-git-p4-path-variations.sh | 200 ++++++++++++++++++++++++++++++++++++++\n>   2 files changed, 207 insertions(+)\n>   create mode 100755 t/t9821-git-p4-path-variations.sh\n>\n> --\n> 1.9.5 (Apple Git-50.3)\n>\n"},{"id":"268630","messageId":"E4AEC9F5-F86A-42FE-A893-E0238AA8E662@gmail.com","threadId":"40168","inReplyTo":"55DC111A.6090501@diamand.org","subject":"Re: [PATCH v5] git-p4: Obey core.ignorecase when using P4 client specs.","fromName":"Lars Schneider","fromEmail":"larsxschneider@gmail.com","sentAt":"2015-08-25T08:17:56Z","receivedAt":"2015-08-25T08:17:56Z","isPatch":true,"sender":{"key":"larsxschneider@gmail.com","avatar":"https://avatars.githubusercontent.com/u/477434?v=4"},"body":"On 25 Aug 2015, at 08:54, Luke Diamand <luke@diamand.org> wrote:\n\n> On 24/08/15 22:30, larsxschneider@gmail.com wrote:\n>> From: Lars Schneider <larsxschneider@gmail.com>\n>> \n>> Thanks to Luke Diamand I realized the core problem and propose here a\n>> substiantially simpler fix to my PATCH v4.\n>> \n>> The test cases remain and prove the problem. In particular\n>> \"8 - Clone path (ignorecase)\" and\n>> \"Add a new file and clone path with new file (ignorecase)\" fail with the\n>> current implementation on OS X and Linux.\n> \n> That's a lot simpler, thanks!\n> \n> Could we give this its own command line option and git config variable?\nCan you outline the command line option you have in mind?\n\n> \n> Core.ignorecase gets set if the client is on a filing system that ignores case. This is slightly different - it squashes case in depot files for people with depots that have incorrectly jumbled-up case.\nWell, you can’t tell if the depots have incorrectly jumbled-up case. It could be intentional after all. Therefore I believe the “ignorecase” flag is a good fit because we explicitly state that we are not interested in case sensitivity on the client.\n\n\n> Conflating the two seems like it would cause confusion at some point - for example, I have no idea how the rest of git behaves if core.ignorecase is set to True on a case-preserving file system.\n> \n> It would probably be necessary to change p4PathStartsWith() to also check the same flag.\n> \n> \n>> \n>> Lars Schneider (1):\n>>   git-p4: Obey core.ignorecase when using P4 client specs.\n>> \n>>  git-p4.py                         |   7 ++\n>>  t/t9821-git-p4-path-variations.sh | 200 ++++++++++++++++++++++++++++++++++++++\n>>  2 files changed, 207 insertions(+)\n>>  create mode 100755 t/t9821-git-p4-path-variations.sh\n>> \n>> --\n>> 1.9.5 (Apple Git-50.3)\n>> \n> \n"},{"id":"268631","messageId":"55DC285D.9030500@web.de","threadId":"40168","inReplyTo":"55DC111A.6090501@diamand.org","subject":"Re: [PATCH v5] git-p4: Obey core.ignorecase when using P4 client specs.","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2015-08-25T08:33:33Z","receivedAt":"2015-08-25T08:33:33Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 08/25/2015 08:54 AM, Luke Diamand wrote:\n> On 24/08/15 22:30, larsxschneider@gmail.com wrote:\n>> From: Lars Schneider <larsxschneider@gmail.com>\n>>\n>> Thanks to Luke Diamand I realized the core problem and propose here a\n>> substiantially simpler fix to my PATCH v4.\n>>\n>> The test cases remain and prove the problem. In particular\n>> \"8 - Clone path (ignorecase)\" and\n>> \"Add a new file and clone path with new file (ignorecase)\" fail with the\n>> current implementation on OS X and Linux.\n>\n> That's a lot simpler, thanks!\n>\n> Could we give this its own command line option and git config variable?\n>\n> Core.ignorecase gets set if the client is on a filing system that \n> ignores case. This is slightly different - it squashes case in depot \n> files for people with depots that have incorrectly jumbled-up case.\n>\n> Conflating the two seems like it would cause confusion at some point - \n> for example, I have no idea how the rest of git behaves if \n> core.ignorecase is set to True on a case-preserving file system.\n>\nThat doesn't work as expected and is not allowed (or say strictly \nforbidden, or strongly recommended not to do)\n\nRemembering older discussions about importers from foreign VCS:\nThis should work best for most people:\nLook at the command line option, if no one is given,\nlook at core.ignorecase.\n\nSo the command line option overrides core.ignorecase,\nand the  user can either run\n--ignore-path-case\nor\n--no-ignore-path-case\n  PS:\nNeed to drop Eric from the list: the MX/A from from web.de problem still \nexists\n"},{"id":"268636","messageId":"23CB37E8-9704-4A9D-8CAB-2812AD59394D@gmail.com","threadId":"40168","inReplyTo":"55DC285D.9030500@web.de","subject":"Re: [PATCH v5] git-p4: Obey core.ignorecase when using P4 client specs.","fromName":"Lars Schneider","fromEmail":"larsxschneider@gmail.com","sentAt":"2015-08-25T10:30:50Z","receivedAt":"2015-08-25T10:30:50Z","isPatch":true,"sender":{"key":"larsxschneider@gmail.com","avatar":"https://avatars.githubusercontent.com/u/477434?v=4"},"body":"On 25 Aug 2015, at 10:33, Torsten Bögershausen <tboegi@web.de> wrote:\n\n> On 08/25/2015 08:54 AM, Luke Diamand wrote:\n>> On 24/08/15 22:30, larsxschneider@gmail.com wrote:\n>>> From: Lars Schneider <larsxschneider@gmail.com>\n>>> \n>>> Thanks to Luke Diamand I realized the core problem and propose here a\n>>> substiantially simpler fix to my PATCH v4.\n>>> \n>>> The test cases remain and prove the problem. In particular\n>>> \"8 - Clone path (ignorecase)\" and\n>>> \"Add a new file and clone path with new file (ignorecase)\" fail with the\n>>> current implementation on OS X and Linux.\n>> \n>> That's a lot simpler, thanks!\n>> \n>> Could we give this its own command line option and git config variable?\n>> \n>> Core.ignorecase gets set if the client is on a filing system that ignores case. This is slightly different - it squashes case in depot files for people with depots that have incorrectly jumbled-up case.\n>> \n>> Conflating the two seems like it would cause confusion at some point - for example, I have no idea how the rest of git behaves if core.ignorecase is set to True on a case-preserving file system.\n>> \n> That doesn't work as expected and is not allowed (or say strictly forbidden, or strongly recommended not to do)\n> \n> Remembering older discussions about importers from foreign VCS:\n> This should work best for most people:\n> Look at the command line option, if no one is given,\n> look at core.ignorecase.\n> \n> So the command line option overrides core.ignorecase,\n> and the  user can either run\n> --ignore-path-case\n> or\n> --no-ignore-path-case\nUnfortunately the command line option is not sufficient as the resulting paths are still messed up. I added the switch but it looks like as core.ignorecase does some additional magic on fast-import. You can see my changes here:\nhttps://github.com/larsxschneider/git/commit/b4399179ff542161c2c5b83c34c5b4901287ceb0\n\nYou can also run the unit tests to see the results here:\nhttps://github.com/larsxschneider/git/tree/lars/fix-path-v5-with-command-switch\n\nThe only way I could image to fix that is to request every path from P4 as shown in my PATCH v4. This would be slow and the change would be rather huge.\n\nI am curious: \nI run all my P4 -> git migrations on a Linux box with EXT4 and core.ignorecase=True. I did not realize that this might cause trouble. What could happen and what should I look out for? \nOne thing to keep in mind: This is a one time migration and we don’t develop on these Linux boxes. We usually develop on Windows and Mac. I just use the Linux boxes as migration workers as these scripts usually run a while.\n\n- Lars"},{"id":"268639","messageId":"CAE5ih7-o6eVF-z2GORxHa_TdDaXgexLpW3jctESTnL46Mfdo8w@mail.gmail.com","threadId":"40168","inReplyTo":"23CB37E8-9704-4A9D-8CAB-2812AD59394D@gmail.com","subject":"Re: [PATCH v5] git-p4: Obey core.ignorecase when using P4 client specs.","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-08-25T11:57:37Z","receivedAt":"2015-08-25T11:57:37Z","isPatch":true,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":" On 25/08/15 11:30, larsxschneider@gmail.com wrote:\n\n> Unfortunately the command line option is not sufficient as the resulting paths are still messed up. I added the switch but it looks like as core.ignorecase does some additional magic on fast-import. You can see my changes here:\n> https://github.com/larsxschneider/git/commit/b4399179ff542161c2c5b83c34c5b4901287ceb0\n>\n> You can also run the unit tests to see the results here:\n> https://github.com/larsxschneider/git/tree/lars/fix-path-v5-with-command-switch\n>\n> The only way I could image to fix that is to request every path from P4 as shown in my PATCH v4. This would be slow and the change would be rather huge.\n\nYes, you're right - fast-import has special handling based on core.ignorecase.\n\nThere was a thread a while back saying that it shouldn't do this, and\ninstead should have a new --casefold option, which would make more\nsense, but isn't the case at present.\n\nhttp://www.spinics.net/lists/git/msg243264.html\n\n> I am curious:\n> I run all my P4 -> git migrations on a Linux box with EXT4 and core.ignorecase=True. I did not realize that this might cause trouble. What could happen and what should I look out for?\n\nAn obvious way it could go wrong would be if you had a a repo that\n_did_ care about case (e.g. had Makefile and makefile in the same\ndirectory) and you then tried to git-p4 clone a separate repo into a\ndifferent branch. In an ideal world, you would only use the\ncase-folding on the git-p4 based repo. I think while fast-import just\nchecks core.ignorecase, that's not possible.\n\nSo the choices are:\n\n1. A new command-line option which would silently set core.ignorecase\n2. Users just have to know to set core.ignorecase manually before\nusing git-p4 (i.e. Lars' patch v5)\n3. Fix fast-import to take a --casefold option (but that's a much bigger change)\n\nLuke\n"},{"id":"268642","messageId":"B7632D9A-BB8B-41E5-9C3D-F7376A0C81D3@gmail.com","threadId":"40168","inReplyTo":"CAE5ih7-o6eVF-z2GORxHa_TdDaXgexLpW3jctESTnL46Mfdo8w@mail.gmail.com","subject":"Re: [PATCH v5] git-p4: Obey core.ignorecase when using P4 client specs.","fromName":"Lars Schneider","fromEmail":"larsxschneider@gmail.com","sentAt":"2015-08-25T13:14:13Z","receivedAt":"2015-08-25T13:14:13Z","isPatch":true,"sender":{"key":"larsxschneider@gmail.com","avatar":"https://avatars.githubusercontent.com/u/477434?v=4"},"body":"On 25 Aug 2015, at 13:57, Luke Diamand <luke@diamand.org> wrote:\n\n> On 25/08/15 11:30, larsxschneider@gmail.com wrote:\n> \n>> Unfortunately the command line option is not sufficient as the resulting paths are still messed up. I added the switch but it looks like as core.ignorecase does some additional magic on fast-import. You can see my changes here:\n>> https://github.com/larsxschneider/git/commit/b4399179ff542161c2c5b83c34c5b4901287ceb0\n>> \n>> You can also run the unit tests to see the results here:\n>> https://github.com/larsxschneider/git/tree/lars/fix-path-v5-with-command-switch\n>> \n>> The only way I could image to fix that is to request every path from P4 as shown in my PATCH v4. This would be slow and the change would be rather huge.\n> \n> Yes, you're right - fast-import has special handling based on core.ignorecase.\n> \n> There was a thread a while back saying that it shouldn't do this, and\n> instead should have a new --casefold option, which would make more\n> sense, but isn't the case at present.\n> \n> http://www.spinics.net/lists/git/msg243264.html\n> \n>> I am curious:\n>> I run all my P4 -> git migrations on a Linux box with EXT4 and core.ignorecase=True. I did not realize that this might cause trouble. What could happen and what should I look out for?\n> \n> An obvious way it could go wrong would be if you had a a repo that\n> _did_ care about case (e.g. had Makefile and makefile in the same\n> directory) and you then tried to git-p4 clone a separate repo into a\n> different branch. In an ideal world, you would only use the\n> case-folding on the git-p4 based repo. I think while fast-import just\n> checks core.ignorecase, that's not possible.\nOK. Thanks for the explanation.\n\n> \n> So the choices are:\n> \n> 1. A new command-line option which would silently set core.ignorecase\n> 2. Users just have to know to set core.ignorecase manually before\n> using git-p4 (i.e. Lars' patch v5)\n> 3. Fix fast-import to take a --casefold option (but that's a much bigger change)\n> \nI vote for 2 because that solves the problem consistently with the existing implementation for now. That means we don’t surprise git-p4 users. In addition I would try to fix (3), the —casefold option, in a separate patch. Although this (3) patch could take a bit as I have two more git-p4 patches in the queue that I want to propose to the mailing list first.\n\n- Lars"},{"id":"268674","messageId":"55DCB2E0.5090605@diamand.org","threadId":"40168","inReplyTo":"B7632D9A-BB8B-41E5-9C3D-F7376A0C81D3@gmail.com","subject":"Re: [PATCH v5] git-p4: Obey core.ignorecase when using P4 client specs.","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-08-25T18:24:32Z","receivedAt":"2015-08-25T18:24:32Z","isPatch":true,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 25/08/15 14:14, Lars Schneider wrote:\n>>\n>> So the choices are:\n>>\n>> 1. A new command-line option which would silently set core.ignorecase\n>> 2. Users just have to know to set core.ignorecase manually before\n>> using git-p4 (i.e. Lars' patch v5)\n>> 3. Fix fast-import to take a --casefold option (but that's a much bigger change)\n>>\n> I vote for 2 because that solves the problem consistently with the existing implementation for now. That means we don’t surprise git-p4 users. In addition I would try to fix (3), the —casefold option, in a separate patch. Although this (3) patch could take a bit as I have two more git-p4 patches in the queue that I want to propose to the mailing list first.\n\nThat works for me. Ack.\n\nThanks!\nLuke\n"},{"id":"268723","messageId":"CAE5ih791vqnyk_J8Sq9LXq+WZW31OwEuCiD6-wwVLo-tXxHOMA@mail.gmail.com","threadId":"40168","inReplyTo":"55DCB2E0.5090605@diamand.org","subject":"Re: [PATCH v5] git-p4: Obey core.ignorecase when using P4 client specs.","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-08-26T10:18:37Z","receivedAt":"2015-08-26T10:18:37Z","isPatch":true,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 25 August 2015 at 19:24, Luke Diamand <luke@diamand.org> wrote:\n> On 25/08/15 14:14, Lars Schneider wrote:\n>>>\n>>>\n>>> So the choices are:\n>>>\n>>> 1. A new command-line option which would silently set core.ignorecase\n>>> 2. Users just have to know to set core.ignorecase manually before\n>>> using git-p4 (i.e. Lars' patch v5)\n>>> 3. Fix fast-import to take a --casefold option (but that's a much bigger\n>>> change)\n>>>\n>> I vote for 2 because that solves the problem consistently with the\n>> existing implementation for now. That means we don’t surprise git-p4 users.\n>> In addition I would try to fix (3), the —casefold option, in a separate\n>> patch. Although this (3) patch could take a bit as I have two more git-p4\n>> patches in the queue that I want to propose to the mailing list first.\n>\n>\n> That works for me. Ack.\n>\n> Thanks!\n> Luke\n\nLars - could you resubmit PATCHv5 as v6, with Acked-by from me added\nafter the Signed-off-by: line.\nIt then this from SubmittingPatches:\n\n> After the list reached a consensus that it is a good idea to apply the\n> patch, re-send it with \"To:\" set to the maintainer [*1*] and \"cc:\" the\n> list [*2*] for inclusion.\n\nThanks\nLuke\n"}]}