git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kristian Amlie <kristian.amlie@nokia.com>
To: ext Johannes Sixt <j.sixt@viscovery.net>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] Make Git respect changes to .gitattributes during checkout.
Date: Thu, 12 Mar 2009 11:23:24 +0100	[thread overview]
Message-ID: <49B8E29C.5080107@nokia.com> (raw)
In-Reply-To: <49B8DD1D.3060908@viscovery.net>

ext Johannes Sixt wrote:
> Kristian Amlie schrieb:
>> We do this by popping off elements on the attribute stack, until we
>> reach the level where a new .gitattributes was checked out. The next
>> time someone calls git_checkattr(), it will reconstruct the
>> attributes from that point.
> ...
>> +	gitattrlen = strlen(GITATTRIBUTES_FILE);
>> +	pathlen = strlen(path);
>> +	if (!strncmp(path + pathlen - gitattrlen, GITATTRIBUTES_FILE, gitattrlen)) {
>> +		/* Invalidate attributes if a new .gitattributes file was checked out. */
> 
> But if there was file .abc.txt that was checked out before .gitattributes
> was checked out, then the new .gitattributes won't have been used for
> .abc.txt, yet, right?

You're right, that fails.

I'm guessing my initial patch (and testcase) works because the sorting
is alphabetical and .gitattributes happens to be checked out before
files with letters. I would need to make sure that .gitattributes gets
checked out first.

--
Kristian

  reply	other threads:[~2009-03-12 10:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-28 15:25 Honoring a checked out gitattributes file Kristian Amlie
2009-01-28 16:44 ` Michael J Gruber
2009-01-28 17:25   ` Kristian Amlie
2009-01-30 13:00     ` Kristian Amlie
2009-01-30 13:00       ` [PATCH] Add a test for checking whether gitattributes is honored by checkout Kristian Amlie
2009-03-12  9:36       ` Honoring a checked out gitattributes file Kristian Amlie
2009-03-12  9:36         ` [PATCH 1/2] Add a test for checking whether gitattributes is honored by checkout Kristian Amlie
2009-03-12  9:36           ` [PATCH 2/2] Make Git respect changes to .gitattributes during checkout Kristian Amlie
2009-03-12  9:59             ` Johannes Sixt
2009-03-12 10:23               ` Kristian Amlie [this message]
2009-03-13 13:24               ` Honoring a checked out gitattributes file Kristian Amlie
2009-03-13 13:24                 ` [PATCH 1/2] Add a test for checking whether gitattributes is honored by checkout Kristian Amlie
2009-03-13 13:24                   ` [PATCH 2/2] Make Git respect changes to .gitattributes during checkout Kristian Amlie
2009-03-14  4:17                     ` Junio C Hamano
2009-03-19 15:42                       ` Kristian Amlie
2009-03-19 21:06                         ` Junio C Hamano
2009-03-20  8:11                           ` Kristian Amlie
2009-03-20  9:32                             ` [PATCH] Add a test for checking whether gitattributes is honored by checkout Kristian Amlie
2009-03-14  4:36                   ` [PATCH 1/2] " Junio C Hamano
2009-03-12  9:47           ` Matthieu Moy
2009-03-12  9:53             ` Kristian Amlie
2009-01-28 17:55 ` Honoring a checked out gitattributes file Jeff King

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=49B8E29C.5080107@nokia.com \
    --to=kristian.amlie@nokia.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.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).