Thread (5 messages) flat view 5 messages, 3 authors, 2016-06-15

Re: [PATCH 2/2] diff_index: honor in-index, not working-tree, .gitattributes

From: Jay Soffian <hidden>
Date: 2016-06-15 22:52:06

Possibly related (same subject, not in this thread)

On Fri, Sep 23, 2011 at 6:21 AM, Michael Haggerty [off-list ref] wrote:
On 09/23/2011 12:39 AM, Junio C Hamano wrote:
quoted
[...] It
would be a regression if the attributes mechanism is used for auditing
purposes (as we start reading from a tree that is being audited using the
very attributes it brings in), though.
I'm confused by this comment.

If an auditing system can be subverted by altering .gitattributes, then
I can do just as much harm by changing the .gitattributes in one commit
and making the "nasty" change in a second.  So any rigorous auditing
system based on .gitattributes would have to prevent me from committing
modifications to .gitattributes, in which case my commit will be
rejected anyway.

If by "auditing" you mean other less rigorous checks to which exceptions
are *allowed*, then it is preferable to add the exception in the same
commit as the otherwise-offending content, and therefore it is
*required* that the .gitattributes of the new tree be used when checking
the contents of that tree.
Currently, an auditing hook that cares about attributes, and which
runs in a bare repo, ignores the in-repo .gitattributes, considering
only the attributes set outside of the repo.

So by making git care about .gitattributes in a bare repo, such a hook
can suddenly be bypassed.

j.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help