git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jay Soffian <jaysoffian@gmail.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>,
	Michael Haggerty <mhagger@alum.mit.edu>
Subject: Re: [PATCH 2/2] diff_index: honor in-index, not working-tree, .gitattributes
Date: Thu, 22 Sep 2011 15:39:20 -0700	[thread overview]
Message-ID: <7v8vpgxkvb.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1316727861-90460-2-git-send-email-jaysoffian@gmail.com> (Jay Soffian's message of "Thu, 22 Sep 2011 17:44:21 -0400")

Jay Soffian <jaysoffian@gmail.com> writes:

> When diff'ing the index against a tree (using either diff-index
> or diff --cached), git previously looked at .gitattributes in the
> working tree before considering .gitattributes in the index, even
> though the diff itself otherwise ignores the working tree.

We can take attributes only from one place (so far from the working tree
and perhaps from the index), people had to live within the limitation that
comes from the "single source only" semantics. It also happens to be
easier to understand (recall the complexity of the examples Jeff gave
about "textconv" during "diff" which ideally should apply from its own
side and "funcname", which does not even have a right answer).

In practice, because development progresses by making everything
(including the .gitattributes file) better, I think "use the newer one"
would be a good compromise when we have two possible sources to grab
attributes from but we can only use one source.

In that sense, I am somewhat skeptical about what this patch tries to
do. The working tree is where people make the progress to update the
index.

A related tangent.

I think the logical conclusion of assuming that we will keep the "single
source only" semantics (which I think we will, by the way, unless I hear a
concrete proposal to how we apply attributes from more than one sources in
what way to which side of the diff) is that a patch might be an
improvement over the current behaviour if it teaches "diff-tree" to read
from the tree and populate the in-core index (never writing it out to
$GIT_DIR/index) from the postimage tree (i.e. "diff preimage postimage" or
"diff -R postimage preimage") when it is run in a bare repository. 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.

  reply	other threads:[~2011-09-22 22:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-22 21:44 [PATCH 1/2] Teach '--cached' option to check-attr Jay Soffian
2011-09-22 21:44 ` [PATCH 2/2] diff_index: honor in-index, not working-tree, .gitattributes Jay Soffian
2011-09-22 22:39   ` Junio C Hamano [this message]
2011-09-23  0:38     ` Jay Soffian
2011-09-23  5:37       ` Jay Soffian
2011-09-23 16:44         ` Junio C Hamano
2011-09-23 21:32           ` Jay Soffian
2011-09-23 21:48             ` Junio C Hamano
2011-09-23 10:21     ` Michael Haggerty
2011-09-23 15:50       ` Jay Soffian
2011-09-22 23:36 ` [PATCH 1/2] Teach '--cached' option to check-attr Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v8vpgxkvb.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jaysoffian@gmail.com \
    --cc=mhagger@alum.mit.edu \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).