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

Re: [PATCH] optionally disable gitattributes

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 27, 2016, 11:59 UTC
Message-ID
<xmqqy4bb8c86.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160127095021.GA25281@ecki.hitronhub.home>
Clemens Buchacher <drizzd@aon.at> writes:
Show 21 quoted lines
> If committed files are not normalized, adding gitattributes has the
> side effect that such files are shown as modified, even though they
> were not actually modified by the user, and the work tree matches
> the committed file. This is because with gitattributes, the file is
> modified on the fly when git reads it from disk, before it compares
> with the index contents.
>
> This is desirable in most situations, because it makes the user
> aware that files should be normalized. However, it can become an
> issue for automation. Since Git considers the work tree to be
> dirty, some operations such as git rebase or git cherry-pick refuse
> to operate. Those commands offer no flag to force overwrite work
> tree changes. The only options are to commit the changes, or to
> remove gitattributes, but that changes the repository state, which
> may be undesirable in a scripted context.
>
> Introduce an environment variable GIT_ATTRIBUTES_DISABLED, which if
> set makes Git ignore any gitattributes.
>
> Signed-off-by: Clemens Buchacher <drizzd@aon.at>
> ---

Is the problem you are trying to solve related to the issue we discussed recently in a nearby thread?

That is, even after "reset --hard", if the result of converting the contents in the index to the working tree representation and then converting that result back to the normalized representation does not match what is in the index, Git would sometimes say that the working tree contents differ from the index?

I think the change in this patch has some uses, and I think the issue we discussed recently in a nearby thread indeed is a problem, but I do not think there is an impedance mismatch beween the two, so I'd like to first make sure you are trying to solve the problem I think you are trying to solve.

Previous: Clemens BuchacherNext: Torsten Bögershausen
Message 2 of 4 in “optionally disable gitattributes”
  1. optionally disable gitattributesClemens Buchacher, Jan 27, 2016
  2. Junio C HamanoJan 27, 2016
  3. Torsten BögershausenJan 27, 2016
  4. Clemens BuchacherJan 27, 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.