git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: .gitignore does not ignore Makefile

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 22, 2016, 18:26 UTC
Message-ID
<xmqqy42j4wp9.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160922154421.GA6641@ikke.info>
Kevin Daudt <me@ikke.info> writes:
Show 5 quoted lines
> Often people advise tricks like `git update-index --assume-unchanges
> <file>`, but this does not work as expected. It's merely a promise to
> git that this file does not change (and hence, git will not check if
> this file has changed when doing git status), but command that try to
> change this file will abort saying that the file has changed.

It actually is even worse. As the user promised Git that the <file> will not be modified and will be kept the same as the version in the index, Git reserves the right to _overwrite_ it with the version in the index anytime when it is convenient to do so, removing whatever local change the user had despite the promise to Git. The "abort saying that the file has changed" is merely various codepaths in the current implementation trying to be extra nice.

Previous: Kevin DaudtNext: Timur Tabi
Message 3 of 6 in “.gitignore does not ignore Makefile”
  1. Timur TabiSep 22, 2016
  2. Kevin DaudtSep 22, 2016
  3. Junio C HamanoSep 22, 2016
  4. Timur TabiSep 22, 2016
  5. Junio C HamanoSep 22, 2016
  6. Jakub NarębskiSep 23, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.