From: Jay Soffian Date: Fri, 23 Sep 2011 21:32:20 GMT Subject: Re: [PATCH 2/2] diff_index: honor in-index, not working-tree, .gitattributes Message-ID: In-Reply-To: <7vobybw6mv.fsf@alter.siamese.dyndns.org> On Fri, Sep 23, 2011 at 12:44 PM, Junio C Hamano wrote: > If you want to allow use of in-tree attributes in _all_ callers of > diff_tree_sha1(), then the right approach is to add an instance of "struct > index_state" to "struct diff_options", have the caller _explicitly_ ask > for use of in-tree attributes by setting a bit somewhere in "struct > diff_options", and read the tree into that separate index_state using > tree.c::read_tree(). I however doubt it is worth it. > > I would think it makes more sense to add a codeblock like that at the > beginning of builtin/diff.c::builtin_diff_tree() when a new command option > asks for it. In that codepath, you _know_ that we are not using the index > at all, and reading the index there will not interfere with other uses of > the index in the program. Hmm, I looked at that, but then it would work for git-diff, but not git-diff-tree. I don't think there's any other diff options that work only at the porcelain layer, are there? j.