{"thread":{"id":"42364","subject":"Ignore updates to files which are ignored, even if they're indexed.","startedAt":"2016-05-18T01:07:16Z","lastAt":"2016-05-18T06:38:51Z","messageCount":2,"participants":["Josh McCullough","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"286849","messageId":"CAK-5vhzvuwteJgWSkAhAAFf9-L4FSs2o58yNF5rQQrrE231d3w@mail.gmail.com","threadId":"42364","inReplyTo":null,"subject":"Ignore updates to files which are ignored, even if they're indexed.","fromName":"Josh McCullough","fromEmail":"joshua.mccullough@gmail.com","sentAt":"2016-05-18T01:07:16Z","receivedAt":"2016-05-18T01:07:16Z","isPatch":false,"sender":{"key":"joshua.mccullough@gmail.com","avatar":null},"body":"TL;DR: Git should ignore files if they are in `.gitignore`, regardless\nof whether or not the file has changed (or been removed).\n\nUse Case\n\nAn initial set of \"local\" config files are committed to a repo. Each\ndeveloper will pull down this set of files, but changes will be\nauto-ignored unless the file is force-added after a change is made.\n\nCurrent Workarounds\n\n1) Use `git update-index --assume-unchanged local-config.xyz` to\nignore local changes to the file.\n2) Add templates instead (local-config.template.xyz) and tell each\ndeveloper to copy these templates and remove the \".template\" portion\nof the file name. The file name without the \".template\" portion is\nadded to `.gitignore`.\n\nThe current workarounds rely on the developer to know/remember what to\ndo. It would be nice if we could do this instead:\n\n1) Create the initial `config-local.xyz`.\n2) Add the new file to the index (`git add`).\n3) Add the same path to `.gitignore`, and add the changes to the index.\n4) Commit the staged changes.\n5) Edit the `config-local.xyz` file.\n6) Run `git status` -- git will not suggest that the file was changed\nsince it is in the `.gitignore`. If 7) The user specifically made\nchanges they wish to commit, the can force-add the ignored file.\n\nDoing a search for [git commit file only once then ignore changes]\nwill show that other people wish for the same feature.\n\n\nThanks!\n\n\n----- ----- -----\n\nSide note: It took me 4 tries to get this email to go through, since\nnon-plain-text messages are strictly forbidden by this mailing list. I\nuse Inbox, which doesn't have an option to ensure a message is sent as\nplain text. I had to switch back to GMail to get it to go through.\n"},{"id":"286858","messageId":"alpine.DEB.2.20.1605180830110.3477@virtualbox","threadId":"42364","inReplyTo":"CAK-5vhzvuwteJgWSkAhAAFf9-L4FSs2o58yNF5rQQrrE231d3w@mail.gmail.com","subject":"Re: Ignore updates to files which are ignored, even if they're indexed.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-05-18T06:38:51Z","receivedAt":"2016-05-18T06:38:51Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Josh,\n\nOn Tue, 17 May 2016, Josh McCullough wrote:\n\n> TL;DR: Git should ignore files if they are in `.gitignore`, regardless\n> of whether or not the file has changed (or been removed).\n\nThis would break at least one of my setups, where I was too lazy to add\nnegative rules to .gitignore.\n\nI imagine that I am not the only one relying on the current behavior.\nWhich means that you would need to tread very carefully should you choose\nto work on this.\n\nBesides, it sounds like you want certain files to be \"tracked a little\",\nand at the same time be \"untracked a little\".\n\nMaybe there is a better solution. Would you care to describe your use case\nin more detail, in particular the goal?\n\nCiao,\nJohannes\n"}]}