{"thread":{"id":"57247","subject":"A new feature command request `cmd_ignore`","startedAt":"2022-01-14T18:56:54Z","lastAt":"2022-01-15T15:38:15Z","messageCount":5,"participants":["Jaydeep Das","Elijah Newren","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"446235","messageId":"11860e44-beff-39e6-2efc-53324223caee@gmail.com","threadId":"57247","inReplyTo":null,"subject":"A new feature command request `cmd_ignore`","fromName":"Jaydeep Das","fromEmail":"jaydeepjd.8914@gmail.com","sentAt":"2022-01-14T18:58:36Z","receivedAt":"2022-01-14T18:56:54Z","isPatch":false,"sender":{"key":"jaydeepjd.8914@gmail.com","avatar":"https://avatars.githubusercontent.com/u/64089730?v=4"},"body":"Generally, To ignore files from a repository, we just have to add the \nfile name in `.gitignore`. But this task becomes a bit\ntedious when there are a lot of unstaged files which you want to ignore.\n\n`git ignore [file names]`\n\nwould add that file to `.gitignore` and other parameters like `--force` \ncould be added which would delete that file cache if that\nfile was already committed.\n\nThis is my very first mail in the mailing list and I look forward to \nbecoming a future contributor to the git project. I would like\nto hear your opinions on this command and would like to implement it if \napproved.\n\nRegards,\nJaydeep.\n\n"},{"id":"446287","messageId":"CABPp-BFY2issEqOj1Oj71k=494vc8E563CndxPZfXYrteFoNhw@mail.gmail.com","threadId":"57247","inReplyTo":"11860e44-beff-39e6-2efc-53324223caee@gmail.com","subject":"Re: A new feature command request `cmd_ignore`","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2022-01-15T05:17:25Z","receivedAt":"2022-01-15T05:17:44Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Fri, Jan 14, 2022 at 3:03 PM Jaydeep Das <jaydeepjd.8914@gmail.com> wrote:\n>\n> Generally, To ignore files from a repository, we just have to add the\n> file name in `.gitignore`. But this task becomes a bit\n> tedious when there are a lot of unstaged files which you want to ignore.\n\n'unstaged' implies the file is tracked (i.e. previously added), but\nhas local changes.  I think you mean 'untracked' here.\n\n> `git ignore [file names]`\n>\n> would add that file to `.gitignore`\n\nIf there are lots of untracked files, why is it less tedious to type\nall of them on the command line, then to type all of them in the\n.gitignore file?  I don't see what effort is being saved.\n\n> and other parameters like `--force`\n> could be added which would delete that file cache if that\n> file was already committed.\n\nI don't understand what you mean by this.\n"},{"id":"446289","messageId":"5f6f1dba-a923-4bb9-70a7-4936566f46e0@kdbg.org","threadId":"57247","inReplyTo":"CABPp-BFY2issEqOj1Oj71k=494vc8E563CndxPZfXYrteFoNhw@mail.gmail.com","subject":"Re: A new feature command request `cmd_ignore`","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2022-01-15T09:03:46Z","receivedAt":"2022-01-15T09:04:05Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 15.01.22 um 06:17 schrieb Elijah Newren:\n> On Fri, Jan 14, 2022 at 3:03 PM Jaydeep Das <jaydeepjd.8914@gmail.com> wrote:\n>> and other parameters like `--force`\n>> could be added which would delete that file cache if that\n>> file was already committed.\n> \n> I don't understand what you mean by this.\n\nI think that is a paraphrase of the suggestion to\n\n   git rm --cached settings\n   echo settings >> .gitignore\n\nwhen changes to a file 'settings' that was already tracked (and often\ncontains user-specific settings) should be ignored. This misguided and\nshort-sighted \"solution\" is repeated numerous times on Stackoverflow.\nNot something that we should encourage.\n\n-- Hannes\n"},{"id":"446291","messageId":"9a3837b4-8c67-e114-e977-f6c7b729ba45@gmail.com","threadId":"57247","inReplyTo":"5f6f1dba-a923-4bb9-70a7-4936566f46e0@kdbg.org","subject":"Re: A new feature command request `cmd_ignore`","fromName":"Jaydeep Das","fromEmail":"jaydeepjd.8914@gmail.com","sentAt":"2022-01-15T10:45:06Z","receivedAt":"2022-01-15T10:43:31Z","isPatch":false,"sender":{"key":"jaydeepjd.8914@gmail.com","avatar":"https://avatars.githubusercontent.com/u/64089730?v=4"},"body":"\n> I think that is a paraphrase of the suggestion to\n\n    git rm --cached settings\n    echo settings >> .gitignore\n\n> when changes to a file 'settings' that was already tracked (and often\n> contains user-specific settings) should be ignored. This misguided and\n> short-sighted \"solution\" is repeated numerous times on Stackoverflow.\n> Not something that we should encourage.\n\nSo what should be done in this scenario? And why is it a discouraged and \nmisguided thing?\n\n\nOn 1/15/22 14:33, Johannes Sixt wrote:\n> Am 15.01.22 um 06:17 schrieb Elijah Newren:\n>> On Fri, Jan 14, 2022 at 3:03 PM Jaydeep Das <jaydeepjd.8914@gmail.com> wrote:\n>>> and other parameters like `--force`\n>>> could be added which would delete that file cache if that\n>>> file was already committed.\n>> I don't understand what you mean by this.\n> I think that is a paraphrase of the suggestion to\n>\n>     git rm --cached settings\n>     echo settings >> .gitignore\n>\n> when changes to a file 'settings' that was already tracked (and often\n> contains user-specific settings) should be ignored. This misguided and\n> short-sighted \"solution\" is repeated numerous times on Stackoverflow.\n> Not something that we should encourage.\n>\n> -- Hannes\n"},{"id":"446294","messageId":"9a7eac53-79fe-24f5-225a-d00d26e67259@kdbg.org","threadId":"57247","inReplyTo":"9a3837b4-8c67-e114-e977-f6c7b729ba45@gmail.com","subject":"Re: A new feature command request `cmd_ignore`","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2022-01-15T15:38:08Z","receivedAt":"2022-01-15T15:38:15Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 15.01.22 um 11:45 schrieb Jaydeep Das:\n> \n>> I think that is a paraphrase of the suggestion to\n> \n>    git rm --cached settings\n>    echo settings >> .gitignore\n> \n>> when changes to a file 'settings' that was already tracked (and often\n>> contains user-specific settings) should be ignored. This misguided and\n>> short-sighted \"solution\" is repeated numerous times on Stackoverflow.\n>> Not something that we should encourage.\n> \n> So what should be done in this scenario? And why is it a discouraged and\n> misguided thing?\n\nIt is misguided because if you commit the removal of 'settings', others\nwho pull/merge this change will either see their 'settings' be removed\n(when they did not change the file) or their pull/merge will fail with\nan error about a modified file being in the way (when they did modify\nit). It causes a whole lot of grief for others.\n\nThere are different ways to address this problem.\n\n- One is to commit a 'settings.template' file that must be copied to\n'settings' and is adjusted as necessary, but not `git add`ed.\n\n- Another is to have a mechanism that can include local files that carry\nthe user-specific settings.\n\n- Yet another is to generate the final file from a tracked template and\na local, untracked, file during the build process.\n\n-- Hannes\n"}]}