git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: "Michael Haggerty" <mhagger@alum.mit.edu>,
	"Torsten Bögershausen" <tboegi@web.de>,
	"git discussion list" <git@vger.kernel.org>
Subject: Re: Surprising interaction of "binary" and "eol" gitattributes
Date: Wed, 11 Mar 2015 14:43:45 -0700	[thread overview]
Message-ID: <xmqq385b5hwu.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <xmqq7fun5ih6.fsf@gitster.dls.corp.google.com> (Junio C. Hamano's message of "Wed, 11 Mar 2015 14:31:33 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> Johannes Sixt <j6t@kdbg.org> writes:
>
>> Isn't it more like: Here we are interested in the "eol" attribute of
>> this file named "a.foo". And the lookup would find the first line that
>> says "eol=crlf". Elsewhere, we are interested in the "binary"
>> attribute of the file named "a.foo", and lookup would find the second
>> line that sets the "binary" attribute. And again elsewhere, we ask for
>> the "text" attribute, and we find the last line that sets the "text"
>> property.
>>
>> Am I totally off track?
>
> In the codepath in question, we say "we are interested in text and
> eol attributes", grab the values (set/unset/set-to-value/unspecified)
> for these two for the path we are interested in from all the
> applicable gitattributes file and then act on the result.

Technically the above is only a half-answer; I know you are
intelligent enough to derive the other untold half from it, but for
the benefit of those reading from sidelines....

The calling convention to (1) prepare the list of attributes you are
interested in upfront and then (2) to ask the set of attributes that
apply among that set for a path is designed to force programmers
avoid doing attribute lookups (which is rather expensive) at random
places in their code.  But in the end, this let us implement the
functionality as you alluded to in the quote paragraph.

If a proposed change wants to make 'text=auto' stronger in the sense
that we decide if we pay attention to 'eol' only after checking if
the contents look non-text, it can do so, just like setting '-text'
to the current code makes settings of 'eol' irrelevant.

  reply	other threads:[~2015-03-11 21:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-05 16:38 Surprising interaction of "binary" and "eol" gitattributes Michael Haggerty
2015-03-05 20:49 ` Torsten Bögershausen
2015-03-05 22:08 ` Junio C Hamano
2015-03-06  5:59   ` Torsten Bögershausen
2015-03-06 17:51     ` Michael Haggerty
2015-03-06 21:30       ` Torsten Bögershausen
2015-03-10 19:25         ` Michael Haggerty
2015-03-10 20:01           ` Junio C Hamano
2015-03-10 22:16             ` Michael Haggerty
2015-03-10 22:54               ` Junio C Hamano
2015-03-11  5:54                 ` Torsten Bögershausen
2015-03-11 17:59                   ` Junio C Hamano
2015-03-11 20:30                 ` Johannes Sixt
2015-03-11 21:31                   ` Junio C Hamano
2015-03-11 21:43                     ` Junio C Hamano [this message]
2015-03-10 20:26           ` Torsten Bögershausen
2015-03-10 22:24             ` Michael Haggerty

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqq385b5hwu.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=mhagger@alum.mit.edu \
    --cc=tboegi@web.de \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).