{"thread":{"id":"55450","subject":"No error when overwriting ignored files","startedAt":"2021-04-07T20:04:38Z","lastAt":"2021-04-07T22:17:56Z","messageCount":4,"participants":["Horst von Brand","Jeff King","Junio C Hamano","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"421145","messageId":"2056254759.360640.1617825398727.JavaMail.zimbra@inf.utfsm.cl","threadId":"55450","inReplyTo":null,"subject":"No error when overwriting ignored files","fromName":"Horst von Brand","fromEmail":"vonbrand@inf.utfsm.cl","sentAt":"2021-04-07T19:56:38Z","receivedAt":"2021-04-07T20:04:38Z","isPatch":false,"sender":{"key":"vonbrand@inf.utfsm.cl","avatar":"https://avatars.githubusercontent.com/u/211384?v=4"},"body":"When pulling from a repository that tracks a file listed in `.gitignore` that would overwrite a local file, this is not reported.\n\nFor example, in the attached repositories, when doing `git pull tst1` in `tst2`, it is (correctly) reported that `ignored.not` would be overwritten, while `ignored.txt` is not reported. \n-- \nDr. Horst H. von Brand                   User #22616 counter.li.org\nDepartamento de Informatica                    Fono: +56 32 2654431\nUniversidad Tecnica Federico Santa Maria             +56 32 2654239\nCasilla 110-V, Valparaiso, Chile 2340000       Fax:  +56 32 2797513\n"},{"id":"421146","messageId":"YG4Tl1IPlFBIhV4l@coredump.intra.peff.net","threadId":"55450","inReplyTo":"2056254759.360640.1617825398727.JavaMail.zimbra@inf.utfsm.cl","subject":"Re: No error when overwriting ignored files","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-04-07T20:18:31Z","receivedAt":"2021-04-07T20:18:37Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Apr 07, 2021 at 03:56:38PM -0400, Horst von Brand wrote:\n\n> When pulling from a repository that tracks a file listed in\n> `.gitignore` that would overwrite a local file, this is not reported.\n> \n> For example, in the attached repositories, when doing `git pull tst1`\n> in `tst2`, it is (correctly) reported that `ignored.not` would be\n> overwritten, while `ignored.txt` is not reported.\n\nThis is behaving as intended. Ignored files are not considered\n\"precious\". You can find more discussion by searching for that term in\nthe list archive.\n\nThere is no concept of \"ignored but precious\" in Git. However, here's an\nold patch series that tries to move in that direction (using an\nattribute):\n\n  https://lore.kernel.org/git/20190216114938.18843-1-pclouds@gmail.com/\n\nAFAIK nobody is actively working on it right now.\n\n-Peff\n"},{"id":"421151","messageId":"xmqqzgy9yg80.fsf@gitster.g","threadId":"55450","inReplyTo":"2056254759.360640.1617825398727.JavaMail.zimbra@inf.utfsm.cl","subject":"Re: No error when overwriting ignored files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-04-07T20:47:27Z","receivedAt":"2021-04-07T20:47:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Horst von Brand <vonbrand@inf.utfsm.cl> writes:\n\n> When pulling from a repository that tracks a file listed in\n> `.gitignore` that would overwrite a local file, this is not\n> reported.\n\nGit has the notion of \"not to be tracked (i.e. added to the index or\ncommitted) and expendable files\", and they are called \"ignored\"\nfiles.  And \".gitignore\" and .git/info/exclude mechanism is used to\nmark these paths.\n\nThere is no notion of \"not to be tracked but precious files\" or\nmechanism to mark paths as such.  So the behaviour you observed is\nfully expected and working as designed.\n\nThanks.\n"},{"id":"421163","messageId":"87a6q9kacx.fsf@evledraar.gmail.com","threadId":"55450","inReplyTo":"YG4Tl1IPlFBIhV4l@coredump.intra.peff.net","subject":"Re: No error when overwriting ignored files","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-04-07T22:17:50Z","receivedAt":"2021-04-07T22:17:56Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Wed, Apr 07 2021, Jeff King wrote:\n\n> On Wed, Apr 07, 2021 at 03:56:38PM -0400, Horst von Brand wrote:\n>\n>> When pulling from a repository that tracks a file listed in\n>> `.gitignore` that would overwrite a local file, this is not reported.\n>> \n>> For example, in the attached repositories, when doing `git pull tst1`\n>> in `tst2`, it is (correctly) reported that `ignored.not` would be\n>> overwritten, while `ignored.txt` is not reported.\n>\n> This is behaving as intended. Ignored files are not considered\n> \"precious\". You can find more discussion by searching for that term in\n> the list archive.\n>\n> There is no concept of \"ignored but precious\" in Git. However, here's an\n> old patch series that tries to move in that direction (using an\n> attribute):\n>\n>   https://lore.kernel.org/git/20190216114938.18843-1-pclouds@gmail.com/\n>\n> AFAIK nobody is actively working on it right now.\n\nHaving re-read that thread now I still think by far the most useful way\nforward with this for anyone who's interested is to investigate/add\nmissing tests for our current behavior, why/when it got introduced,\nwhether anyone wanted it or if it was emergent etc. See [1] for a\nsummary.\n\nThat's quite a bit of work, but is work that someone with little/no\nprevious familiarity with git's development should be able to do with\nenough time & motivation....\n\n1. https://lore.kernel.org/git/87ftsi68ke.fsf@evledraar.gmail.com/\n"}]}