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

Re: show/diff --check clarification needed

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 28, 2010, 20:25 UTC
Message-ID
<7vmxzykmdp.fsf@alter.siamese.dyndns.org>
In-Reply-To
<d26982ce92a061ee24d04aba6e314fa4.squirrel@intranet.linagora.com>
"Yann Dirson" <ydirson@altern.org> writes:
Show 5 quoted lines
> Unless I missed something, I suggest the following plan:
>
> - document in maint that --check only takes worktree into account when
>   looking for .gitattributes, and more globally add a note to the
>   gitattributes manpage to explicitely say that too.

It is not limited to "diff --check". The current implementation reads attributes only from the checked out work tree and/or from the index, depending on the direction of operation (e.g. checking out files to work tree reads from the index, I think). The same issue would affect "git archive" when generating a tarball from an older revision.

The exception is $GIT_DIR/info/gitattributes, and for your particular purpose, I think it is the right one to use, because the entries in that file will apply regardless of which version you are examining patches from.

> - add a global flag to allow something like
>   "git --attributes-tree=<treeish> <command>"

I am not sure if this is what we really want. It seems to me that it would make more sense to read from a relevant tree that the <command> is operating on, if we are to enhance the attributes implementation. If that <treeish> is a fixed one, it is not much better than having necessary entries in your $GIT_DIR/info/gitattributes file.

> - adjust defaults to agreed-upon values
> - add any config entries that would be meaningful
Sorry, I have no idea what you mean by these two points.
Thanks.
Previous: Yann DirsonNext: Yann Dirson
Message 2 of 3 in “show/diff --check clarification needed”
  1. Yann DirsonJan 27, 2010
  2. Junio C HamanoJan 28, 2010
  3. Yann DirsonJan 28, 2010

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.