{"thread":{"id":"28008","subject":"[PATCH 0/2] Clarify semantics of git attribute macros","startedAt":"2011-08-03T13:41:28Z","lastAt":"2011-08-03T22:40:33Z","messageCount":7,"participants":["Michael Haggerty","Jeff King","Philip Oakley","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"172763","messageId":"1312378890-31703-1-git-send-email-mhagger@alum.mit.edu","threadId":"28008","inReplyTo":null,"subject":"[PATCH 0/2] Clarify semantics of git attribute macros","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2011-08-03T13:41:28Z","receivedAt":"2011-08-03T13:41:28Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"Make it clearer that attribute macros do not only affect other\nattributes, but are attributes themselves.\n\nThe second patch changes the nomenclature in gitattributes(5) from\n\"attribute macro\" to \"macro attribute\", which I think makes the point\na tiny bit clearer.  But it is definitely optional.\n\nMichael Haggerty (2):\n  gitattributes: Clarify discussion of attribute macros\n  gitattributes: Reword \"attribute macro\" to \"macro attribute\"\n\n Documentation/gitattributes.txt |   25 ++++++++++++++-----------\n 1 files changed, 14 insertions(+), 11 deletions(-)\n\n-- \n1.7.6.8.gd2879\n"},{"id":"172764","messageId":"1312378890-31703-2-git-send-email-mhagger@alum.mit.edu","threadId":"28008","inReplyTo":"1312378890-31703-1-git-send-email-mhagger@alum.mit.edu","subject":"[PATCH 1/2] gitattributes: Clarify discussion of attribute macros","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2011-08-03T13:41:29Z","receivedAt":"2011-08-03T13:41:29Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"In particular, make it clear that attribute macros are themselves\nrecorded as attributes in addition to setting other attributes.\n\nSigned-off-by: Michael Haggerty <mhagger@alum.mit.edu>\n---\n Documentation/gitattributes.txt |   13 ++++++++-----\n 1 files changed, 8 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\nindex 412c55b..ccb3f3f 100644\n--- a/Documentation/gitattributes.txt\n+++ b/Documentation/gitattributes.txt\n@@ -879,16 +879,19 @@ produced for, any binary file you track.  You would need to specify e.g.\n ------------\n \n but that may become cumbersome, when you have many attributes.  Using\n-attribute macros, you can specify groups of attributes set or unset at\n-the same time.  The system knows a built-in attribute macro, `binary`:\n+attribute macros, you can define an attribute that, when set, also\n+sets or unsets a number of other attributes at the same time.  The\n+system knows a built-in attribute macro, `binary`:\n \n ------------\n *.jpg binary\n ------------\n \n-which is equivalent to the above.  Note that the attribute macros can only\n-be \"Set\" (see the above example that sets \"binary\" macro as if it were an\n-ordinary attribute --- setting it in turn unsets \"text\" and \"diff\").\n+Setting the \"binary\" attribute also unsets the \"text\" and \"diff\"\n+attributes as above.  Note that attribute macros can only be \"Set\",\n+though setting one might have the effect of setting or unsetting other\n+attributes or even returning other attributes to the \"Unspecified\"\n+state.\n \n \n DEFINING ATTRIBUTE MACROS\n-- \n1.7.6.8.gd2879\n"},{"id":"172765","messageId":"1312378890-31703-3-git-send-email-mhagger@alum.mit.edu","threadId":"28008","inReplyTo":"1312378890-31703-1-git-send-email-mhagger@alum.mit.edu","subject":"[PATCH 2/2] gitattributes: Reword \"attribute macro\" to \"macro attribute\"","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2011-08-03T13:41:30Z","receivedAt":"2011-08-03T13:41:30Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"The new wording makes it clearer that such a beast is an attribute in\naddition to being a macro (as opposed to being only a macro that is\nused for attributes).\n\nSigned-off-by: Michael Haggerty <mhagger@alum.mit.edu>\n---\n Documentation/gitattributes.txt |   18 +++++++++---------\n 1 files changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\nindex ccb3f3f..2bbe76b 100644\n--- a/Documentation/gitattributes.txt\n+++ b/Documentation/gitattributes.txt\n@@ -79,7 +79,7 @@ Attributes for all users on a system should be placed in the\n `$(prefix)/etc/gitattributes` file.\n \n Sometimes you would need to override an setting of an attribute\n-for a path to `unspecified` state.  This can be done by listing\n+for a path to `Unspecified` state.  This can be done by listing\n the name of the attribute prefixed with an exclamation point `!`.\n \n \n@@ -868,7 +868,7 @@ If this attribute is not set or has an invalid value, the value of the\n (See linkgit:git-config[1]).\n \n \n-USING ATTRIBUTE MACROS\n+USING MACRO ATTRIBUTES\n ----------------------\n \n You do not want any end-of-line conversions applied to, nor textual diffs\n@@ -879,27 +879,27 @@ produced for, any binary file you track.  You would need to specify e.g.\n ------------\n \n but that may become cumbersome, when you have many attributes.  Using\n-attribute macros, you can define an attribute that, when set, also\n+macro attributes, you can define an attribute that, when set, also\n sets or unsets a number of other attributes at the same time.  The\n-system knows a built-in attribute macro, `binary`:\n+system knows a built-in macro attribute, `binary`:\n \n ------------\n *.jpg binary\n ------------\n \n Setting the \"binary\" attribute also unsets the \"text\" and \"diff\"\n-attributes as above.  Note that attribute macros can only be \"Set\",\n+attributes as above.  Note that macro attributes can only be \"Set\",\n though setting one might have the effect of setting or unsetting other\n attributes or even returning other attributes to the \"Unspecified\"\n state.\n \n \n-DEFINING ATTRIBUTE MACROS\n+DEFINING MACRO ATTRIBUTES\n -------------------------\n \n-Custom attribute macros can be defined only in the `.gitattributes` file\n-at the toplevel (i.e. not in any subdirectory).  The built-in attribute\n-macro \"binary\" is equivalent to:\n+Custom macro attributes can be defined only in the `.gitattributes`\n+file at the toplevel (i.e. not in any subdirectory).  The built-in\n+macro attribute \"binary\" is equivalent to:\n \n ------------\n [attr]binary -diff -text\n-- \n1.7.6.8.gd2879\n"},{"id":"172801","messageId":"20110803194632.GB23848@sigill.intra.peff.net","threadId":"28008","inReplyTo":"1312378890-31703-2-git-send-email-mhagger@alum.mit.edu","subject":"Re: [PATCH 1/2] gitattributes: Clarify discussion of attribute macros","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-08-03T19:46:32Z","receivedAt":"2011-08-03T19:46:32Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Aug 03, 2011 at 03:41:29PM +0200, Michael Haggerty wrote:\n\n> -which is equivalent to the above.  Note that the attribute macros can only\n> -be \"Set\" (see the above example that sets \"binary\" macro as if it were an\n> -ordinary attribute --- setting it in turn unsets \"text\" and \"diff\").\n> +Setting the \"binary\" attribute also unsets the \"text\" and \"diff\"\n> +attributes as above.  Note that attribute macros can only be \"Set\",\n> +though setting one might have the effect of setting or unsetting other\n> +attributes or even returning other attributes to the \"Unspecified\"\n> +state.\n\nThis is slightly confusing. You can \"unset\" an attribute macro, and it\nwill be reported as \"unset\". Which seems to contradict what is written\nabove (although the error comes from the previous text). I think there\nare two possibilities for what a user might expect unsetting a macro to\ndo for the sub-attributes:\n\n  1. Leave them unspecified.\n\n  2. Negate them (i.e., \"-binary\" means \"text diff\".\n\nand we do (1).\n\nI don't know if that was intentional, or if the behavior is simply\naccidental and the original code was simply never meant to have\n\"-binary\" called at all.\n\n-Peff\n"},{"id":"172807","messageId":"9F6331D9665D41C4A1B4BF9CAB4F5EF6@PhilipOakley","threadId":"28008","inReplyTo":"1312378890-31703-1-git-send-email-mhagger@alum.mit.edu","subject":"Re: [PATCH 0/2] Clarify semantics of git attribute macros","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2011-08-03T21:34:51Z","receivedAt":"2011-08-03T21:34:51Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Michael Haggerty\"\n> Make it clearer that attribute macros do not only affect other\n> attributes, but are attributes themselves.\n\nI felt that this summary was the better wording. It is simple and direct.\ni.e. \"Note: Attribute macros not only affect attributes, but are attributes \nthemselves.\"\n\nPhilip Oakley\nScotland \n"},{"id":"172810","messageId":"7v1ux2b2d8.fsf@alter.siamese.dyndns.org","threadId":"28008","inReplyTo":"20110803194632.GB23848@sigill.intra.peff.net","subject":"Re: [PATCH 1/2] gitattributes: Clarify discussion of attribute macros","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-08-03T21:40:19Z","receivedAt":"2011-08-03T21:40:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> I don't know if that was intentional, or if the behavior is simply\n> accidental and the original code was simply never meant to have\n> \"-binary\" called at all.\n\nThe latter. You were never expected to say -macro at all.\n"},{"id":"172828","messageId":"20110803224032.GA31153@sigill.intra.peff.net","threadId":"28008","inReplyTo":"7v1ux2b2d8.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/2] gitattributes: Clarify discussion of attribute macros","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-08-03T22:40:33Z","receivedAt":"2011-08-03T22:40:33Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Aug 03, 2011 at 02:40:19PM -0700, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > I don't know if that was intentional, or if the behavior is simply\n> > accidental and the original code was simply never meant to have\n> > \"-binary\" called at all.\n> \n> The latter. You were never expected to say -macro at all.\n\nOK. Maybe we should flag an error, then? Or if not, then make the\ndocumentation more clear that it's not allowed (or even say the current\nbehavior is reasonable, and document it).\n\n-Peff\n"}]}