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.