{"thread":{"id":"31781","subject":"[PATCH] attr: a note about the order of .gitattributes lookup","startedAt":"2012-10-10T13:55:52Z","lastAt":"2012-10-10T18:04:32Z","messageCount":2,"participants":["Nguyen Thai Ngoc Duy","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"200922","messageId":"20121010135552.GA11293@do","threadId":"31781","inReplyTo":null,"subject":"[PATCH] attr: a note about the order of .gitattributes lookup","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-10-10T13:55:52Z","receivedAt":"2012-10-10T13:55:52Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"This is the documentation part of\n\n1a9d7e9 (attr.c: read .gitattributes from index as well. - 2007-08-14)\n06f33c1 (Read attributes from the index that is being checked out - 2009-03-13)\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n I looked around but did not see anywhere mentioning this. If I did\n not miss anything, then we should take a note about this to avoid\n surprises.\n\n Resend, this time git@vger is CCed. Sorry for the noise.\n\n Documentation/gitattributes.txt | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\nindex 99ed04d..8c52a99 100644\n--- a/Documentation/gitattributes.txt\n+++ b/Documentation/gitattributes.txt\n@@ -66,6 +66,12 @@ is from the path in question, the lower its precedence). Finally\n global and system-wide files are considered (they have the lowest\n precedence).\n \n+Normally if `.gitattributes` is not found in a directory in work tree,\n+the same path in the index is examined. If there's a `.gitattributes`\n+version in the index, that version will be used. During checkout process,\n+the order of examination is reversed: index version is preferred over\n+the work tree version.\n+\n If you wish to affect only a single repository (i.e., to assign\n attributes to files that are particular to\n one user's workflow for that repository), then\n-- \n1.7.12.1.406.g6ab07c4\n"},{"id":"200934","messageId":"7vd30qcifj.fsf@alter.siamese.dyndns.org","threadId":"31781","inReplyTo":"20121010135552.GA11293@do","subject":"Re: [PATCH] attr: a note about the order of .gitattributes lookup","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-10T18:04:32Z","receivedAt":"2012-10-10T18:04:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n\n> This is the documentation part of\n>\n> 1a9d7e9 (attr.c: read .gitattributes from index as well. - 2007-08-14)\n> 06f33c1 (Read attributes from the index that is being checked out - 2009-03-13)\n>\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>  I looked around but did not see anywhere mentioning this. If I did\n>  not miss anything, then we should take a note about this to avoid\n>  surprises.\n>\n>  Resend, this time git@vger is CCed. Sorry for the noise.\n>\n>  Documentation/gitattributes.txt | 6 ++++++\n>  1 file changed, 6 insertions(+)\n>\n> diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\n> index 99ed04d..8c52a99 100644\n> --- a/Documentation/gitattributes.txt\n> +++ b/Documentation/gitattributes.txt\n> @@ -66,6 +66,12 @@ is from the path in question, the lower its precedence). Finally\n>  global and system-wide files are considered (they have the lowest\n>  precedence).\n>  \n> +Normally if `.gitattributes` is not found in a directory in work tree,\n> +the same path in the index is examined. If there's a `.gitattributes`\n> +version in the index, that version will be used. During checkout process,\n> +the order of examination is reversed: index version is preferred over\n> +the work tree version.\n> +\n\nYeah, thanks for writing it up.  The \"direction\" fix was done to\nhelp people when they check out a commit when a different commit\nwith different .gitattributes is checked out to the working tree.\n\n>  If you wish to affect only a single repository (i.e., to assign\n>  attributes to files that are particular to\n>  one user's workflow for that repository), then\n"}]}