{"thread":{"id":"44312","subject":"[RFC] Case insensitive Git attributes","startedAt":"2016-10-17T01:04:40Z","lastAt":"2016-10-17T17:50:29Z","messageCount":9,"participants":["Lars Schneider","Stefan Beller","Torsten Bögershausen","Johannes Schindelin","Duy Nguyen","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"304254","messageId":"C83BE22D-EAC8-49E2-AEE3-22D4A99AE205@gmail.com","threadId":"44312","inReplyTo":null,"subject":"[RFC] Case insensitive Git attributes","fromName":"Lars Schneider","fromEmail":"larsxschneider@gmail.com","sentAt":"2016-10-17T01:04:26Z","receivedAt":"2016-10-17T01:04:40Z","isPatch":false,"sender":{"key":"larsxschneider@gmail.com","avatar":"https://avatars.githubusercontent.com/u/477434?v=4"},"body":"Hi,\n\nGit attributes for path names are generally case sensitive. However, on \na case insensitive file system (e.g. macOS/Windows) they appear to be\ncase insensitive (`*.bar` would match `foo.bar` and `foo.BAR`). That \nworks great until a Git users joins the party with a case sensitive file \nsystem. For this Git user only files that match the exact case of the \nattribute pattern get the attributes (only `foo.bar`).\n\nThis inconsistent behavior can confuse Git users. An advanced Git user\ncould use a glob pattern (e.g. `*.[bB][aA][rR]) to match files in a\ncase insensitive way. However, this can get confusing quickly, too.\n\nI wonder if we can do something about this. One idea could be to add an\nattribute \"case-sensitive\" (or \"caseSensitive\") and set it to false \n(if desired) for all files in .gitattributes for a given repo.\n\n### .gitattributes example ###\n\n* case-sensitive=false\n*.bar something\n\n###\n\nI haven't looked into the feasibility of an implementation, yet. However,\nwould that be an acceptable approach?\n\nThanks,\nLars\n\n\n\n"},{"id":"304257","messageId":"CAGZ79kZ6KaQ5gjGiEFQ-pRJCDAyS0oH=_4dK0nCU9hx8wZwdfw@mail.gmail.com","threadId":"44312","inReplyTo":"C83BE22D-EAC8-49E2-AEE3-22D4A99AE205@gmail.com","subject":"Re: [RFC] Case insensitive Git attributes","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-10-17T03:07:47Z","receivedAt":"2016-10-17T03:07:53Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Sun, Oct 16, 2016 at 6:04 PM, Lars Schneider\n<larsxschneider@gmail.com> wrote:\n> Hi,\n>\n> Git attributes for path names are generally case sensitive. However, on\n> a case insensitive file system (e.g. macOS/Windows) they appear to be\n> case insensitive (`*.bar` would match `foo.bar` and `foo.BAR`). That\n> works great until a Git users joins the party with a case sensitive file\n> system. For this Git user only files that match the exact case of the\n> attribute pattern get the attributes (only `foo.bar`).\n>\n> This inconsistent behavior can confuse Git users. An advanced Git user\n> could use a glob pattern (e.g. `*.[bB][aA][rR]) to match files in a\n> case insensitive way. However, this can get confusing quickly, too.\n>\n> I wonder if we can do something about this. One idea could be to add an\n> attribute \"case-sensitive\" (or \"caseSensitive\") and set it to false\n> (if desired) for all files in .gitattributes for a given repo.\n\nFYI: I am currently refactoring the attr subsystem (e.g.\nhttps://public-inbox.org/git/20161012224109.23410-1-sbeller@google.com/\n\"attr: convert to new threadsafe API\")\n\n>\n> ### .gitattributes example ###\n>\n> * case-sensitive=false\n\nWould this modify the current file only or the whole stack of attrs?\n(In just one way or the whole stack, i.e. can you add this in .git/info/exclude\nand the attribute file in the home dir also behaves differently? Or rather the\nother way round when the system wide attr file enables case insensitivity,\neach repository local config is set automatically? both ways?)\n\n> *.bar something\n>\n> ###\n>\n> I haven't looked into the feasibility of an implementation, yet. However,\n> would that be an acceptable approach?\n\nConceptually I would prefer if we had a single switch that indicates a\ncase insensitive FS. That could be used for different purposes as well,\nthat are FS relevant such as checking in, checking out/renaming files\nin the working tree? (does any such switch already exist for case\nsensitivity?)\n\nThanks,\nStefan\n\n>\n> Thanks,\n> Lars\n>\n>\n>\n"},{"id":"304258","messageId":"8df71a3a-64a6-2ec4-fd04-ae4f9bd4c2f5@web.de","threadId":"44312","inReplyTo":"CAGZ79kZ6KaQ5gjGiEFQ-pRJCDAyS0oH=_4dK0nCU9hx8wZwdfw@mail.gmail.com","subject":"Re: [RFC] Case insensitive Git attributes","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-10-17T04:24:31Z","receivedAt":"2016-10-17T04:25:03Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"\n\nOn 17/10/16 05:07, Stefan Beller wrote:\n> On Sun, Oct 16, 2016 at 6:04 PM, Lars Schneider\n> <larsxschneider@gmail.com> wrote:\n>> Hi,\n>>\n>> Git attributes for path names are generally case sensitive. However, on\n>> a case insensitive file system (e.g. macOS/Windows) they appear to be\n>> case insensitive (`*.bar` would match `foo.bar` and `foo.BAR`).\nThis feels like a bug:\n\n$ git diff\ndiff --git a/.gitattributes b/.gitattributes\nindex 5e98806..1419867 100644\n--- a/.gitattributes\n+++ b/.gitattributes\n@@ -1,3 +1,4 @@\n  * whitespace=!indent,trail,space\n  *.[ch] whitespace=indent,trail,space\n  *.sh whitespace=indent,trail,space\n+*.C text\n\n-----------\n$ git -c core.ignorecase=false check-attr --all git.c\ngit.c: whitespace: indent,trail,space\n\n#But running on a case insensitve FS I get:\n$ git  check-attr --all git.c\ngit.c: text: set\ngit.c: whitespace: indent,trail,space\n\n\n>> That\n>> works great until a Git users joins the party with a case sensitive file\n>> system. For this Git user only files that match the exact case of the\n>> attribute pattern get the attributes (only `foo.bar`).\n>>\n>> This inconsistent behavior can confuse Git users. An advanced Git user\n>> could use a glob pattern (e.g. `*.[bB][aA][rR]) to match files in a\n>> case insensitive way. However, this can get confusing quickly, too.\n>>\n>> I wonder if we can do something about this. One idea could be to add an\n>> attribute \"case-sensitive\" (or \"caseSensitive\") and set it to false\n>> (if desired) for all files in .gitattributes for a given repo.\n> FYI: I am currently refactoring the attr subsystem (e.g.\n> https://public-inbox.org/git/20161012224109.23410-1-sbeller@google.com/\n> \"attr: convert to new threadsafe API\")\n>\n>> ### .gitattributes example ###\n>>\n>> * case-sensitive=false\nHow about\n* ignorecase=true\n  ?\n\n> Would this modify the current file only or the whole stack of attrs?\n> (In just one way or the whole stack, i.e. can you add this in .git/info/exclude\n> and the attribute file in the home dir also behaves differently? Or rather the\n> other way round when the system wide attr file enables case insensitivity,\n> each repository local config is set automatically? both ways?)\n>\n>> *.bar something\n>>\n>> ###\n>>\n>> I haven't looked into the feasibility of an implementation, yet. However,\n>> would that be an acceptable approach?\n> Conceptually I would prefer if we had a single switch that indicates a\n> case insensitive FS. That could be used for different purposes as well,\n> that are FS relevant such as checking in, checking out/renaming files\n> in the working tree? (does any such switch already exist for case\n> sensitivity?)\n>\n> Thanks,\n> Stefan\n>\n>> Thanks,\n>> Lars\n>>\n>>\n>>\n\n"},{"id":"304261","messageId":"alpine.DEB.2.20.1610171054550.197091@virtualbox","threadId":"44312","inReplyTo":"C83BE22D-EAC8-49E2-AEE3-22D4A99AE205@gmail.com","subject":"Re: [RFC] Case insensitive Git attributes","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-10-17T08:55:54Z","receivedAt":"2016-10-17T08:56:04Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Lars,\n\nOn Sun, 16 Oct 2016, Lars Schneider wrote:\n\n> One idea could be to add an attribute \"case-sensitive\" (or\n> \"caseSensitive\") and set it to false (if desired) for all files in\n> .gitattributes for a given repo.\n> \n> ### .gitattributes example ###\n> \n> * case-sensitive=false\n> *.bar something\n> \n> ###\n\nHrm. Maybe a better idea would be to warn when attributes match a file\nname with a different case?\n\nCiao,\nDscho\n"},{"id":"304262","messageId":"alpine.DEB.2.20.1610171056170.197091@virtualbox","threadId":"44312","inReplyTo":"CAGZ79kZ6KaQ5gjGiEFQ-pRJCDAyS0oH=_4dK0nCU9hx8wZwdfw@mail.gmail.com","subject":"Re: [RFC] Case insensitive Git attributes","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-10-17T08:57:51Z","receivedAt":"2016-10-17T08:57:58Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Stefan,\n\nOn Sun, 16 Oct 2016, Stefan Beller wrote:\n\n> Conceptually I would prefer if we had a single switch that indicates a\n> case insensitive FS.\n\nAFAIU Lars' use case is where the FS is *case sensitive*, but he still\nneeds the .gitattributes to be *case insensitive* because that file\noriginates from a developer with such a file system.\n\nOtherwise he would simply tack onto the core.ignoreCase flag.\n\nCiao,\nDscho\n"},{"id":"304264","messageId":"CACsJy8BBLcZvB1FswcEKS1KgvjMjo_uaVqOTgjmMJkjnmoye+w@mail.gmail.com","threadId":"44312","inReplyTo":"alpine.DEB.2.20.1610171056170.197091@virtualbox","subject":"Re: [RFC] Case insensitive Git attributes","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-10-17T09:12:28Z","receivedAt":"2016-10-17T09:13:13Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Oct 17, 2016 at 3:57 PM, Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n> Hi Stefan,\n>\n> On Sun, 16 Oct 2016, Stefan Beller wrote:\n>\n>> Conceptually I would prefer if we had a single switch that indicates a\n>> case insensitive FS.\n>\n> AFAIU Lars' use case is where the FS is *case sensitive*, but he still\n> needs the .gitattributes to be *case insensitive* because that file\n> originates from a developer with such a file system.\n>\n> Otherwise he would simply tack onto the core.ignoreCase flag.\n\nThat sounds to me like setting core.ignoreCase to true (on all devs'\nrepo) would \"solve\" this. Yes core.ignoreCase may introduce some side\neffects when used on case-sensitive filesystems, so we probably want\nsomething in the same spirit but limited to .gitattributes and\n.gitignore only.\n-- \nDuy\n"},{"id":"304270","messageId":"alpine.DEB.2.20.1610171241240.197091@virtualbox","threadId":"44312","inReplyTo":"CACsJy8BBLcZvB1FswcEKS1KgvjMjo_uaVqOTgjmMJkjnmoye+w@mail.gmail.com","subject":"Re: [RFC] Case insensitive Git attributes","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-10-17T10:46:20Z","receivedAt":"2016-10-17T10:46:31Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Duy,\n\nOn Mon, 17 Oct 2016, Duy Nguyen wrote:\n\n> On Mon, Oct 17, 2016 at 3:57 PM, Johannes Schindelin\n> <Johannes.Schindelin@gmx.de> wrote:\n> > Hi Stefan,\n> >\n> > On Sun, 16 Oct 2016, Stefan Beller wrote:\n> >\n> >> Conceptually I would prefer if we had a single switch that indicates a\n> >> case insensitive FS.\n> >\n> > AFAIU Lars' use case is where the FS is *case sensitive*, but he still\n> > needs the .gitattributes to be *case insensitive* because that file\n> > originates from a developer with such a file system.\n> >\n> > Otherwise he would simply tack onto the core.ignoreCase flag.\n> \n> That sounds to me like setting core.ignoreCase to true (on all devs'\n> repo) would \"solve\" this.\n\nIt is good that you quoted this verb, because it does not solve things.\nInstead, it would try to use the flag for two slightly incompatible\npurposes at the same time.\n\nThe first (and so far, only) purpose is to tell Git that the current file\nsystem is case insensitive.\n\nThe new purpose you described would be to tell Git that the *user* does\nnot care about the file names' case, even if the file system does.\n\nI do not think that this leads to a better situation than before. Instead,\nI am convinced that it will cause new and sometimes \"entertaining\"\nproblems because you can no longer discern between those two purposes\nbased on core.ignoreCase, you would have to teach Git to test every single\ntime whether the file system is case-sensitive or not.\n\nNeedless to say, I'd rather not see that happening. Many users, including\nmy colleagues and myself, rely on Git being a rock solid piece of\nsoftware, and that change would make it less so.\n\nCiao,\nDscho\n"},{"id":"304271","messageId":"CACsJy8ASnvryrrWvr4ACWL_9oeKgE_4SUqcRHGf+Y6kcaeDUhg@mail.gmail.com","threadId":"44312","inReplyTo":"alpine.DEB.2.20.1610171241240.197091@virtualbox","subject":"Re: [RFC] Case insensitive Git attributes","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-10-17T11:02:50Z","receivedAt":"2016-10-17T11:03:26Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Oct 17, 2016 at 5:46 PM, Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n> Hi Duy,\n>\n> On Mon, 17 Oct 2016, Duy Nguyen wrote:\n>\n>> On Mon, Oct 17, 2016 at 3:57 PM, Johannes Schindelin\n>> <Johannes.Schindelin@gmx.de> wrote:\n>> > Hi Stefan,\n>> >\n>> > On Sun, 16 Oct 2016, Stefan Beller wrote:\n>> >\n>> >> Conceptually I would prefer if we had a single switch that indicates a\n>> >> case insensitive FS.\n>> >\n>> > AFAIU Lars' use case is where the FS is *case sensitive*, but he still\n>> > needs the .gitattributes to be *case insensitive* because that file\n>> > originates from a developer with such a file system.\n>> >\n>> > Otherwise he would simply tack onto the core.ignoreCase flag.\n>>\n>> That sounds to me like setting core.ignoreCase to true (on all devs'\n>> repo) would \"solve\" this.\n>\n> It is good that you quoted this verb, because it does not solve things.\n> Instead, it would try to use the flag for two slightly incompatible\n> purposes at the same time.\n>\n> The first (and so far, only) purpose is to tell Git that the current file\n> system is case insensitive.\n>\n> The new purpose you described would be to tell Git that the *user* does\n> not care about the file names' case, even if the file system does.\n>\n> I do not think that this leads to a better situation than before. Instead,\n> I am convinced that it will cause new and sometimes \"entertaining\"\n> problems because you can no longer discern between those two purposes\n> based on core.ignoreCase, you would have to teach Git to test every single\n> time whether the file system is case-sensitive or not.\n\nI agree. Which is why I wrote \"we probably want something in the same\nspirit but limited to .gitattributes and .gitignore only\". In other\nwords we could have core.someName that makes .gitattributes and\n.gitignore patterns case-insensitive (or core-sensitive). If it's\npresent, it overrides core.ignoreCase. If it's not present,\ncore.ignoreCase decides. I'm just not sure if the new config should\ncover everything involving filename's case in git. That's too big to\nfit in my head.\n\n> Needless to say, I'd rather not see that happening. Many users, including\n> my colleagues and myself, rely on Git being a rock solid piece of\n> software, and that change would make it less so.\n-- \nDuy\n"},{"id":"304290","messageId":"xmqqzim2vp9e.fsf@gitster.mtv.corp.google.com","threadId":"44312","inReplyTo":"CACsJy8ASnvryrrWvr4ACWL_9oeKgE_4SUqcRHGf+Y6kcaeDUhg@mail.gmail.com","subject":"Re: [RFC] Case insensitive Git attributes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-10-17T17:50:21Z","receivedAt":"2016-10-17T17:50:29Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Duy Nguyen <pclouds@gmail.com> writes:\n\n> I agree. Which is why I wrote \"we probably want something in the same\n> spirit but limited to .gitattributes and .gitignore only\". In other\n> words we could have core.someName that makes .gitattributes and\n> .gitignore patterns case-insensitive (or core-sensitive). If it's\n> present, it overrides core.ignoreCase. If it's not present,\n> core.ignoreCase decides. I'm just not sure if the new config should\n> cover everything involving filename's case in git. That's too big to\n> fit in my head.\n\nOnce I stopped thinking about this as \"filename's case\", it does fit\nmy head ;-)\n\nI view the proposed knob as making patterns in .gitattributes and\n.gitignore case insensitive, iow, it is a lazy and useful short-hand\nfor (mentally) editing \"*.c attr\" to \"*.[cC] attr\" without touching\nthese files.\n\nAnd I agree that the knob that is missing in today's Git should\ndefault to whatever core.ignoreCase's value is, iow, on case\ninsensitive filesystem, attr and ignore may match case insensitively\nin today's Git, but when the knob is introduced, it should allow\nforcing case sensitive match there by setting it to false, just like\nthe knob is proposed to be used in the oppositite direction to force\ncase insensitive match regardless of the case insensitiveness of the\nunderlying filesystem.\n"}]}