{"thread":{"id":"15880","subject":"[PATCH] Improve and fix git-check-attr(1)","startedAt":"2008-10-13T17:57:05Z","lastAt":"2008-10-15T07:11:52Z","messageCount":4,"participants":["Jonas Fonseca","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"92953","messageId":"20081013175705.GA9538@diku.dk","threadId":"15880","inReplyTo":null,"subject":"[PATCH] Improve and fix git-check-attr(1)","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2008-10-13T17:57:05Z","receivedAt":"2008-10-13T17:57:05Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Always use 'verse' for multi-line synopsis sections. Add output and\nexample sections to document what output can be expected.\n\nSigned-off-by: Jonas Fonseca <fonseca@diku.dk>\n\n---\n Documentation/git-check-attr.txt |   63 +++++++++++++++++++++++++++++++++++++-\n 1 files changed, 62 insertions(+), 1 deletions(-)\n\n At least the first chunk should be applied. The last is a quick attempt\n at documenting the expected output formally and with examples.\n\ndiff --git a/Documentation/git-check-attr.txt b/Documentation/git-check-attr.txt\nindex 14e4374..09c5234 100644\n--- a/Documentation/git-check-attr.txt\n+++ b/Documentation/git-check-attr.txt\n@@ -8,8 +8,9 @@ git-check-attr - Display gitattributes information.\n \n SYNOPSIS\n --------\n+[verse]\n 'git check-attr' attr... [--] pathname...\n-'git check-attr' --stdin [-z] attr... < <list-of-paths\n+'git check-attr' --stdin [-z] attr... < <list-of-paths>\n \n DESCRIPTION\n -----------\n@@ -30,6 +31,66 @@ OPTIONS\n \targuments as path names. If not supplied, only the first argument will\n \tbe treated as an attribute.\n \n+OUTPUT\n+------\n+\n+The output is of the form:\n+<path> COLON SP <attribute> COLON SP <info> LF\n+\n+Where <path> is the path of a file being queried, <attribute> is an attribute\n+being queried and <info> can be either:\n+\n+'unspecified';; when the attribute is not defined for the path.\n+'unset';; when the attribute is defined to false.\n+'set';; when the attribute is defined to true.\n+<value>;; when a value has been assigned to the attribute.\n+\n+EXAMPLES\n+--------\n+\n+In the following examples, the following '.gitattributes' file is used:\n+---------------\n+*.java diff=java -crlf myAttr\n+README caveat=unspecified\n+---------------\n+\n+* Output for an unspecified attribute:\n+---------------\n+$ git check-attr filter src/org/example/lib/MyClass.java\n+src/org/example/lib/MyClass.java: filter: unspecified\n+---------------\n+\n+* Output for an unset attribute:\n+---------------\n+$ git check-attr crlf src/org/example/lib/MyClass.java\n+src/org/example/lib/MyClass.java: crlf: unset\n+---------------\n+\n+* Output for an attribute that has been set:\n+---------------\n+$ git check-attr myAttr src/org/example/lib/MyClass.java\n+src/org/example/lib/MyClass.java: myAttr: set\n+---------------\n+\n+* Output for an attribute set to a value:\n+---------------\n+$ git check-attr diff src/org/example/lib/MyClass.java\n+src/org/example/lib/MyClass.java: diff: java\n+---------------\n+\n+* Listing multiple attributes for a file:\n+---------------\n+$ git check-attr crlf diff myAttr -- src/org/example/lib/MyClass.java\n+src/org/example/lib/MyClass.java: crlf: unset\n+src/org/example/lib/MyClass.java: diff: java\n+src/org/example/lib/MyClass.java: myAttr: set\n+---------------\n+\n+* Not all values are equally unambiguous:\n+---------------\n+$ git check-attr caveat README\n+src/org/example/lib/MyClass.java: caveat: unspecified\n+---------------\n \n SEE ALSO\n --------\n-- \ntg: (340fcf4..) jf/man-git-check-attr (depends on: next)\n\n-- \nJonas Fonseca\n"},{"id":"93046","messageId":"7vabd6686n.fsf@gitster.siamese.dyndns.org","threadId":"15880","inReplyTo":"20081013175705.GA9538@diku.dk","subject":"Re: [PATCH] Improve and fix git-check-attr(1)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-10-14T23:58:08Z","receivedAt":"2008-10-14T23:58:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonas Fonseca <fonseca@diku.dk> writes:\n\n> Always use 'verse' for multi-line synopsis sections. Add output and\n> example sections to document what output can be expected.\n>\n> Signed-off-by: Jonas Fonseca <fonseca@diku.dk>\n>\n> ---\n>  Documentation/git-check-attr.txt |   63 +++++++++++++++++++++++++++++++++++++-\n>  1 files changed, 62 insertions(+), 1 deletions(-)\n>\n>  At least the first chunk should be applied. The last is a quick attempt\n>  at documenting the expected output formally and with examples.\n> ...\n> tg: (340fcf4..) jf/man-git-check-attr (depends on: next)\n\nShould this really have to depend on next?  I have a feeling that a large\npart of this (sans --stdin/-z) is a 'maint' material.\n\nCould you split this into two patches, one for 'maint' to describe the\noutput format, and another for 'next' (or 'dp/checkattr') to update the\nSYNOPSIS part?\n"},{"id":"93061","messageId":"20081015071058.GA32094@diku.dk","threadId":"15880","inReplyTo":"7vabd6686n.fsf@gitster.siamese.dyndns.org","subject":"[PATCH 1/2] git-check-attr(1): add output and example sections","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2008-10-15T07:10:58Z","receivedAt":"2008-10-15T07:10:58Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Plumbing tools should document what output can be expected.\n\nSigned-off-by: Jonas Fonseca <fonseca@diku.dk>\n---\n Documentation/git-check-attr.txt |   50 ++++++++++++++++++++++++++++++++++++++\n 1 files changed, 50 insertions(+), 0 deletions(-)\n\n Junio C Hamano <gitster@pobox.com> wrote Tue, Oct 14, 2008:\n > Should this really have to depend on next?\n\n This is just topgit listing the patch dependencies.\n\n > Could you split this into two patches, one for 'maint' to describe the\n > output format, and another for 'next' (or 'dp/checkattr') to update the\n > SYNOPSIS part?\n\n Done. The example has been updated to also show '!' in action.\n\ndiff --git a/Documentation/git-check-attr.txt b/Documentation/git-check-attr.txt\nindex 2b821f2..8460a87 100644\n--- a/Documentation/git-check-attr.txt\n+++ b/Documentation/git-check-attr.txt\n@@ -22,6 +22,56 @@ OPTIONS\n \targuments as path names. If not supplied, only the first argument will\n \tbe treated as an attribute.\n \n+OUTPUT\n+------\n+\n+The output is of the form:\n+<path> COLON SP <attribute> COLON SP <info> LF\n+\n+Where <path> is the path of a file being queried, <attribute> is an attribute\n+being queried and <info> can be either:\n+\n+'unspecified';; when the attribute is not defined for the path.\n+'unset';;\twhen the attribute is defined to false.\n+'set';;\t\twhen the attribute is defined to true.\n+<value>;;\twhen a value has been assigned to the attribute.\n+\n+EXAMPLES\n+--------\n+\n+In the examples, the following '.gitattributes' file is used:\n+---------------\n+*.java diff=java -crlf myAttr\n+NoMyAttr.java !myAttr\n+README caveat=unspecified\n+---------------\n+\n+* Listing a single attribute:\n+---------------\n+$ git check-attr diff org/example/MyClass.java\n+org/example/MyClass.java: diff: java\n+---------------\n+\n+* Listing multiple attributes for a file:\n+---------------\n+$ git check-attr crlf diff myAttr -- org/example/MyClass.java\n+org/example/MyClass.java: crlf: unset\n+org/example/MyClass.java: diff: java\n+org/example/MyClass.java: myAttr: set\n+---------------\n+\n+* Listing attribute for multiple files:\n+---------------\n+$ git check-attr myAttr -- org/example/MyClass.java org/example/NoMyAttr.java\n+org/example/MyClass.java: myAttr: set\n+org/example/NoMyAttr.java: myAttr: unspecified\n+---------------\n+\n+* Not all values are equally unambiguous:\n+---------------\n+$ git check-attr caveat README\n+README: caveat: unspecified\n+---------------\n \n SEE ALSO\n --------\n-- \ntg: (6c16792..) jf/man-git-check-attr-output (depends on: maint)\n\n-- \nJonas Fonseca\n"},{"id":"93062","messageId":"20081015071152.GB32094@diku.dk","threadId":"15880","inReplyTo":"7vabd6686n.fsf@gitster.siamese.dyndns.org","subject":"[PATCH 2/2] git-check-attr(1): use 'verse' for multi-line synopsis sections","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2008-10-15T07:11:52Z","receivedAt":"2008-10-15T07:11:52Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Signed-off-by: Jonas Fonseca <fonseca@diku.dk>\n---\n Documentation/git-check-attr.txt |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-check-attr.txt b/Documentation/git-check-attr.txt\nindex 59d5cd2..dcf7650 100644\n--- a/Documentation/git-check-attr.txt\n+++ b/Documentation/git-check-attr.txt\n@@ -8,8 +8,9 @@ git-check-attr - Display gitattributes information.\n \n SYNOPSIS\n --------\n+[verse]\n 'git check-attr' attr... [--] pathname...\n-'git check-attr' --stdin [-z] attr... < <list-of-paths\n+'git check-attr' --stdin [-z] attr... < <list-of-paths>\n \n DESCRIPTION\n -----------\n-- \ntg: (34458dd..) jf/man-git-check-attr-synopsis (depends on: jf/man-git-check-attr-output next)\n\n-- \nJonas Fonseca\n"}]}