{"thread":{"id":"18708","subject":"git diff bug?","startedAt":"2009-04-04T01:10:42Z","lastAt":"2009-04-07T18:25:00Z","messageCount":13,"participants":["David Abrahams","Jeff King","Michael J Gruber","Matthieu Moy","Junio C Hamano","Antriksh Pany"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"110316","messageId":"m2ocvdkyul.fsf@boostpro.com","threadId":"18708","inReplyTo":null,"subject":"git diff bug?","fromName":"David Abrahams","fromEmail":"dave@boostpro.com","sentAt":"2009-04-04T01:10:42Z","receivedAt":"2009-04-04T01:10:42Z","isPatch":false,"sender":{"key":"dave@boostpro.com","avatar":"https://gravatar.com/avatar/df0921f05114687777894565de21c052fb137ba7c303a399528b43d08833f065?d=mp&s=160"},"body":"\nPlease see\nhttp://github.com/techarcana/elisp/commit/63d672c296316c85690085930b05c642b88a9978#diff-2\n\nNote how the @@ ... @@ clauses are followed by text from the previous\nline's comment.  Not sure, but this strikes me as a line-ending issue.\ncustom.el was originally built on a linux machine; now I'm using a Mac.\n\nThanks!\n\n-- \nDave Abrahams\nBoostPro Computing\nhttp://www.boostpro.com\n"},{"id":"110318","messageId":"20090404014527.GA13350@coredump.intra.peff.net","threadId":"18708","inReplyTo":"m2ocvdkyul.fsf@boostpro.com","subject":"Re: git diff bug?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-04-04T01:45:27Z","receivedAt":"2009-04-04T01:45:27Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Apr 03, 2009 at 09:10:42PM -0400, David Abrahams wrote:\n\n> Please see\n> http://github.com/techarcana/elisp/commit/63d672c296316c85690085930b05c642b88a9978#diff-2\n> \n> Note how the @@ ... @@ clauses are followed by text from the previous\n> line's comment.  Not sure, but this strikes me as a line-ending issue.\n> custom.el was originally built on a linux machine; now I'm using a Mac.\n\nThis is as designed. The original file (\"git show e7dd7db\") contains (my\nnumbering seems different than what git produces; it is produced by \"nl\"\nwhich is maybe treating some line endings differently earlier in the\nfile):\n\n   102   '(mm-attachment-override-types (quote (\"text/x-vcard\" \"application/pkcs7-mime\" \"application/x-pkcs7-mime\" \"application/pkcs7-signature\" \"application/x-pkcs7-signature\" \"image/*\")) nil nil \"\n   103  Added image/* to display attached images inline\")\n   104   '(mm-discouraged-alternatives (quote (\"text/html\" \"text/richtext\" \"image/.*\")) nil nil \"\n   105  The documentation for this variable says it all\")\n   106   '(mm-inline-text-html-with-images t)\n   107   '(muse-project-alist (quote ((\"WikiPlanner\" (\"~/plans\" :default \"index\" :major-mode planner-mode :visit-link planner-visit-link)))))\n   108   '(org-agenda-files (quote (\"~/organizer.org\")))\n\nThe changed text in your diff starts on 108. So we show 105-107 as\ncontext lines. The text after the @@ clause is the \"function header\";\nthis is equivalent to \"-p\" in GNU diff. It's basically a guess about the\nmost interesting context to show, and looks alphabetic characters that\nare left-aligned. In the case of lisp, it really isn't all that\ninteresting (and what looks so weird is that your file contains\na lot of\n\n  \"\\nSome text\"\n\nso the text strings are all left-aligned. You can customize the regex\nused to guess at the function header. See \"defining a custom\nhunk-header\" in \"git help attributes\".\n\n-Peff\n"},{"id":"110320","messageId":"20090404015242.GA13932@coredump.intra.peff.net","threadId":"18708","inReplyTo":"20090404014527.GA13350@coredump.intra.peff.net","subject":"Re: git diff bug?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-04-04T01:52:42Z","receivedAt":"2009-04-04T01:52:42Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Apr 03, 2009 at 09:45:27PM -0400, Jeff King wrote:\n\n> This is as designed. The original file (\"git show e7dd7db\") contains (my\n> numbering seems different than what git produces; it is produced by \"nl\"\n> which is maybe treating some line endings differently earlier in the\n> file):\n\nSorry, this was just me failing to use \"nl\" correctly. I needed to use\n\"-ba\" to number empty lines. So the line numbers do match git, and the\nrest of my explanation holds.\n\n-Peff\n"},{"id":"110547","messageId":"1BF9172A-BE91-4D1C-932A-EB9FD79BA402@boostpro.com","threadId":"18708","inReplyTo":"20090404014527.GA13350@coredump.intra.peff.net","subject":"Re: git diff bug?","fromName":"David Abrahams","fromEmail":"dave@boostpro.com","sentAt":"2009-04-06T09:09:32Z","receivedAt":"2009-04-06T09:09:32Z","isPatch":false,"sender":{"key":"dave@boostpro.com","avatar":"https://gravatar.com/avatar/df0921f05114687777894565de21c052fb137ba7c303a399528b43d08833f065?d=mp&s=160"},"body":"\nOn Apr 3, 2009, at 9:45 PM, Jeff King wrote:\n\n> On Fri, Apr 03, 2009 at 09:10:42PM -0400, David Abrahams wrote:\n>\n>> Please see\n>> http://github.com/techarcana/elisp/commit/63d672c296316c85690085930b05c642b88a9978#diff-2\n>>\n>> Note how the @@ ... @@ clauses are followed by text from the previous\n>> line's comment.  Not sure, but this strikes me as a line-ending  \n>> issue.\n>> custom.el was originally built on a linux machine; now I'm using a  \n>> Mac.\n>\n> This is as designed. The original file (\"git show e7dd7db\") contains  \n> (my\n> numbering seems different than what git produces; it is produced by  \n> \"nl\"\n> which is maybe treating some line endings differently earlier in the\n> file):\n>\n>   102   '(mm-attachment-override-types (quote (\"text/x-vcard\"  \n> \"application/pkcs7-mime\" \"application/x-pkcs7-mime\" \"application/ \n> pkcs7-signature\" \"application/x-pkcs7-signature\" \"image/*\")) nil nil \"\n>   103  Added image/* to display attached images inline\")\n>   104   '(mm-discouraged-alternatives (quote (\"text/html\" \"text/ \n> richtext\" \"image/.*\")) nil nil \"\n>   105  The documentation for this variable says it all\")\n>   106   '(mm-inline-text-html-with-images t)\n>   107   '(muse-project-alist (quote ((\"WikiPlanner\" (\"~/ \n> plans\" :default \"index\" :major-mode planner-mode :visit-link planner- \n> visit-link)))))\n>   108   '(org-agenda-files (quote (\"~/organizer.org\")))\n>\n> The changed text in your diff starts on 108. So we show 105-107 as\n> context lines. The text after the @@ clause is the \"function header\";\n> this is equivalent to \"-p\" in GNU diff. It's basically a guess about  \n> the\n> most interesting context to show, and looks alphabetic characters that\n> are left-aligned. In the case of lisp, it really isn't all that\n> interesting (and what looks so weird is that your file contains\n> a lot of\n>\n>  \"\\nSome text\"\n>\n> so the text strings are all left-aligned. You can customize the regex\n> used to guess at the function header. See \"defining a custom\n> hunk-header\" in \"git help attributes\".\n\nHmm, so I tried sticking this .gitattributes in my repo\n\n   *.el   diff=el\n   [diff \"el\"]\n         xfuncname = \"^(\\\\(def[a-z]+ .+)$\"\n\nand git diff barfed with\n\n   \"el\"] is not a valid attribute name: .gitattributes:2\n   \"^(\\\\(def[a-z]+ is not a valid attribute name: .gitattributes:3\n\nWhat am I missing?  I tried googling, but from what turns up for me,  \nit doesn't look like anyone else has ever tried to use this feature!\n\nTIA,\n\n--\nDavid Abrahams\nBoostPro Computing\nhttp://boostpro.com\n"},{"id":"110588","messageId":"49DA156A.1000105@drmicha.warpmail.net","threadId":"18708","inReplyTo":"1BF9172A-BE91-4D1C-932A-EB9FD79BA402@boostpro.com","subject":"Re: git diff bug?","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-04-06T14:44:58Z","receivedAt":"2009-04-06T14:44:58Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"David Abrahams venit, vidit, dixit 06.04.2009 11:09:\n> \n> On Apr 3, 2009, at 9:45 PM, Jeff King wrote:\n> \n>> On Fri, Apr 03, 2009 at 09:10:42PM -0400, David Abrahams wrote:\n>>\n>>> Please see\n>>> http://github.com/techarcana/elisp/commit/63d672c296316c85690085930b05c642b88a9978#diff-2\n>>>\n>>> Note how the @@ ... @@ clauses are followed by text from the previous\n>>> line's comment.  Not sure, but this strikes me as a line-ending  \n>>> issue.\n>>> custom.el was originally built on a linux machine; now I'm using a  \n>>> Mac.\n>>\n>> This is as designed. The original file (\"git show e7dd7db\") contains  \n>> (my\n>> numbering seems different than what git produces; it is produced by  \n>> \"nl\"\n>> which is maybe treating some line endings differently earlier in the\n>> file):\n>>\n>>   102   '(mm-attachment-override-types (quote (\"text/x-vcard\"  \n>> \"application/pkcs7-mime\" \"application/x-pkcs7-mime\" \"application/ \n>> pkcs7-signature\" \"application/x-pkcs7-signature\" \"image/*\")) nil nil \"\n>>   103  Added image/* to display attached images inline\")\n>>   104   '(mm-discouraged-alternatives (quote (\"text/html\" \"text/ \n>> richtext\" \"image/.*\")) nil nil \"\n>>   105  The documentation for this variable says it all\")\n>>   106   '(mm-inline-text-html-with-images t)\n>>   107   '(muse-project-alist (quote ((\"WikiPlanner\" (\"~/ \n>> plans\" :default \"index\" :major-mode planner-mode :visit-link planner- \n>> visit-link)))))\n>>   108   '(org-agenda-files (quote (\"~/organizer.org\")))\n>>\n>> The changed text in your diff starts on 108. So we show 105-107 as\n>> context lines. The text after the @@ clause is the \"function header\";\n>> this is equivalent to \"-p\" in GNU diff. It's basically a guess about  \n>> the\n>> most interesting context to show, and looks alphabetic characters that\n>> are left-aligned. In the case of lisp, it really isn't all that\n>> interesting (and what looks so weird is that your file contains\n>> a lot of\n>>\n>>  \"\\nSome text\"\n>>\n>> so the text strings are all left-aligned. You can customize the regex\n>> used to guess at the function header. See \"defining a custom\n>> hunk-header\" in \"git help attributes\".\n> \n> Hmm, so I tried sticking this .gitattributes in my repo\n> \n>    *.el   diff=el\n>    [diff \"el\"]\n>          xfuncname = \"^(\\\\(def[a-z]+ .+)$\"\n> \n> and git diff barfed with\n> \n>    \"el\"] is not a valid attribute name: .gitattributes:2\n>    \"^(\\\\(def[a-z]+ is not a valid attribute name: .gitattributes:3\n> \n> What am I missing?  I tried googling, but from what turns up for me,  \n> it doesn't look like anyone else has ever tried to use this feature!\n\nWell, I don't think anayone else has tried putting config lines into\n.gitattributes ;)\n\nThe \"*.el\" line goes into .gitattributes (or .git/info/a...), the other\nlines are config lines and thus goe into .git/config or .gitconfig.\n\nMichael\n"},{"id":"110596","messageId":"20090406155303.GA3275@sigill.intra.peff.net","threadId":"18708","inReplyTo":"1BF9172A-BE91-4D1C-932A-EB9FD79BA402@boostpro.com","subject":"Re: git diff bug?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-04-06T15:53:04Z","receivedAt":"2009-04-06T15:53:04Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Apr 06, 2009 at 05:09:32AM -0400, David Abrahams wrote:\n\n> Hmm, so I tried sticking this .gitattributes in my repo\n>\n>   *.el   diff=el\n>   [diff \"el\"]\n>         xfuncname = \"^(\\\\(def[a-z]+ .+)$\"\n>\n> and git diff barfed with\n\nAs Michael explained, the first line goes into .gitattributes, and the\nsecond two go into your .git/config.\n\nThe reason is that the first line is describing a property of files\nin the repo: \"*.el is of type 'el' for diffing\". And thus it makes sense\nfor it to be committed along with the content in the repo.\n\nBut the latter two lines are about preference: \"here is how _I_ would\nlike to generate diffs for el files\". So they go in your personal config\nwhich is not shipped with the repo. And most likely you would want to\nput them not in per-repo config, but in your user config:\n$HOME/.gitconfig.\n\nAll of that being said, it is obviously a documentation failure if it\ndidn't explain in which files the various parts go. If you don't mind,\ncan you skim over the documentation you read one more time and point out\nwhere it led you wrong?  Maybe we can make it a little clearer.\n\n-Peff\n"},{"id":"110607","messageId":"vpqeiw53cpy.fsf@bauges.imag.fr","threadId":"18708","inReplyTo":"20090406155303.GA3275@sigill.intra.peff.net","subject":"Re: git diff bug?","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-04-06T17:37:29Z","receivedAt":"2009-04-06T17:37:29Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> But the latter two lines are about preference: \"here is how _I_ would\n> like to generate diffs for el files\".\n\n... and they are commands to be executed. If they were in the\nrepository, and propagated with clone, then doing\n\ngit clone git://some.git/repo\ncd repo\ngit diff\n\nwould execute arbitrary commands, which wouldn't be acceptable for\nsecurity reasons.\n\n-- \nMatthieu\n"},{"id":"110609","messageId":"7vskkl64yu.fsf@gitster.siamese.dyndns.org","threadId":"18708","inReplyTo":"vpqeiw53cpy.fsf@bauges.imag.fr","subject":"Re: git diff bug?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-04-06T17:56:41Z","receivedAt":"2009-04-06T17:56:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> Jeff King <peff@peff.net> writes:\n>\n>> But the latter two lines are about preference: \"here is how _I_ would\n>> like to generate diffs for el files\".\n>\n> ... and they are commands to be executed. If they were in the\n> repository, and propagated with clone, then doing\n>\n> git clone git://some.git/repo\n> cd repo\n> git diff\n>\n> would execute arbitrary commands, which wouldn't be acceptable for\n> security reasons.\n\nOther configuration variables have such security implications, but diff\nhunk header bit doesn't.  You are a bit overly cautious in this particular\ncase.\n"},{"id":"110610","messageId":"D4B0EDF7-E1BD-44E3-858F-002CFF2C496A@boostpro.com","threadId":"18708","inReplyTo":"49DA156A.1000105@drmicha.warpmail.net","subject":"Re: git diff bug?","fromName":"David Abrahams","fromEmail":"dave@boostpro.com","sentAt":"2009-04-06T17:58:08Z","receivedAt":"2009-04-06T17:58:08Z","isPatch":false,"sender":{"key":"dave@boostpro.com","avatar":"https://gravatar.com/avatar/df0921f05114687777894565de21c052fb137ba7c303a399528b43d08833f065?d=mp&s=160"},"body":"\nOn Apr 6, 2009, at 10:44 AM, Michael J Gruber wrote:\n\n>\n> Well, I don't think anayone else has tried putting config lines into\n> .gitattributes ;)\n>\n> The \"*.el\" line goes into .gitattributes (or .git/info/a...), the  \n> other\n> lines are config lines and thus goe into .git/config or .gitconfig.\n\n\nAha, thanks.  The hunk header section in the gitattributes manpage  \nturns out to be the only one that shows config stuff without  \nmentioning a config file, thus my confusion.  I suggest a tiny patch  \n('cept I don't know how to write manpage format)\n\n--\nDavid Abrahams\nBoostPro Computing\nhttp://boostpro.com\n"},{"id":"110613","messageId":"0DEF7B81-61C6-4971-BC5B-5C31D62D091B@boostpro.com","threadId":"18708","inReplyTo":"20090406155303.GA3275@sigill.intra.peff.net","subject":"Re: git diff bug?","fromName":"David Abrahams","fromEmail":"dave@boostpro.com","sentAt":"2009-04-06T18:16:25Z","receivedAt":"2009-04-06T18:16:25Z","isPatch":false,"sender":{"key":"dave@boostpro.com","avatar":"https://gravatar.com/avatar/df0921f05114687777894565de21c052fb137ba7c303a399528b43d08833f065?d=mp&s=160"},"body":"\nOn Apr 6, 2009, at 11:53 AM, Jeff King wrote:\n\n> All of that being said, it is obviously a documentation failure if it\n> didn't explain in which files the various parts go. If you don't mind,\n> can you skim over the documentation you read one more time and point  \n> out\n> where it led you wrong?  Maybe we can make it a little clearer.\n\nWow, that is a *really* admirable response.  Git itself may be a tad  \narcane, but the community has been fantastic. Thanks billionses for  \nthat -- it can only mean more a more learnable Git down the road.  I  \nposted an answer to your question in a different reply.\n\n--\nDavid Abrahams\nBoostPro Computing\nhttp://boostpro.com\n"},{"id":"110615","messageId":"20090406184830.GA28120@coredump.intra.peff.net","threadId":"18708","inReplyTo":"D4B0EDF7-E1BD-44E3-858F-002CFF2C496A@boostpro.com","subject":"Re: git diff bug?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-04-06T18:48:30Z","receivedAt":"2009-04-06T18:48:30Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Apr 06, 2009 at 01:58:08PM -0400, David Abrahams wrote:\n\n>> The \"*.el\" line goes into .gitattributes (or .git/info/a...), the other\n>> lines are config lines and thus goe into .git/config or .gitconfig.\n>\n> Aha, thanks.  The hunk header section in the gitattributes manpage turns \n> out to be the only one that shows config stuff without mentioning a config \n> file, thus my confusion.  I suggest a tiny patch ('cept I don't know how \n> to write manpage format)\n\nNeither do I, but fortunately the git docs are all written in asciidoc. :)\n\nJunio, does the patch below make sense to you?\n\n-- >8 --\nSubject: [PATCH] doc/gitattributes: clarify location of config text\n\nThe gitattributes documentation has a section on the \"diff\"\nattribute, with subsections for each of the things you might\nwant to configure in your diff config section (external\ndiff, hunk headers, etc). The first such subsection\nspecifically notes that the definition of the diff driver\nshould go into $GIT_DIR/config, but subsequent sections do\nnot.\n\nThis location is implied if you are reading the\ndocumentation sequentially, but it is not uncommon for a new\nuser to jump to (or be referred to) a specific section. For\na new user who does not know git well enough to recognize\nthe config syntax, it is not clear that those directives\ndon't also go into the gitattributes file.\n\nThis patch just mentions the config file in each subsection,\nsimilar to the way it is mentioned in the first.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nMentioning $GIT_DIR/config _and_ $HOME/.gitconfig in each subsection may\nseem like overkill, but I really think we shouldn't make any assumption\nthat a reader has seen the previous sections. They otherwise stand alone\nvery well.\n\nI arrived at these three sections by grepping for '^[' to find example\nconfig file syntax.\n\n Documentation/gitattributes.txt |    9 ++++++---\n 1 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\nindex 55668e3..b6260b1 100644\n--- a/Documentation/gitattributes.txt\n+++ b/Documentation/gitattributes.txt\n@@ -297,7 +297,8 @@ for paths.\n \n Then, you would define a \"diff.tex.xfuncname\" configuration to\n specify a regular expression that matches a line that you would\n-want to appear as the hunk header \"TEXT\", like this:\n+want to appear as the hunk header \"TEXT\". Add a section to your\n+`$GIT_DIR/config` file (or `$HOME/.gitconfig` file) like this:\n \n ------------------------\n [diff \"tex\"]\n@@ -345,7 +346,8 @@ split words in a line, by specifying an appropriate regular expression\n in the \"diff.*.wordRegex\" configuration variable.  For example, in TeX\n a backslash followed by a sequence of letters forms a command, but\n several such commands can be run together without intervening\n-whitespace.  To separate them, use a regular expression such as\n+whitespace.  To separate them, use a regular expression in your\n+`$GIT_DIR/config` file (or `$HOME/.gitconfig` file) like this:\n \n ------------------------\n [diff \"tex\"]\n@@ -373,7 +375,8 @@ resulting text on stdout.\n \n For example, to show the diff of the exif information of a\n file instead of the binary information (assuming you have the\n-exif tool installed):\n+exif tool installed), add the following section to your\n+`$GIT_DIR/config` file (or `$HOME/.gitconfig` file):\n \n ------------------------\n [diff \"jpg\"]\n-- \n1.6.2.2.585.g1e067\n"},{"id":"110623","messageId":"vpqzlet1stg.fsf@bauges.imag.fr","threadId":"18708","inReplyTo":"7vskkl64yu.fsf@gitster.siamese.dyndns.org","subject":"Re: git diff bug?","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-04-06T19:32:43Z","receivedAt":"2009-04-06T19:32:43Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n>\n>> Jeff King <peff@peff.net> writes:\n>>\n>>> But the latter two lines are about preference: \"here is how _I_ would\n>>> like to generate diffs for el files\".\n>>\n>> ... and they are commands to be executed. If they were in the\n>> repository, and propagated with clone, then doing\n>>\n>> git clone git://some.git/repo\n>> cd repo\n>> git diff\n>>\n>> would execute arbitrary commands, which wouldn't be acceptable for\n>> security reasons.\n>\n> Other configuration variables have such security implications, but diff\n> hunk header bit doesn't.  You are a bit overly cautious in this particular\n> case.\n\nOops, right, I was thinking of other parameters in the same section of\nthe config file. Thanks for correcting.\n\n-- \nMatthieu\n"},{"id":"110725","messageId":"e6cd6cf90904071125m3009c34dv9b9c037a98983405@mail.gmail.com","threadId":"18708","inReplyTo":"1BF9172A-BE91-4D1C-932A-EB9FD79BA402@boostpro.com","subject":"Re: git diff bug?","fromName":"Antriksh Pany","fromEmail":"antriksh.pany@gmail.com","sentAt":"2009-04-07T18:25:00Z","receivedAt":"2009-04-07T18:25:00Z","isPatch":false,"sender":{"key":"antriksh.pany@gmail.com","avatar":null},"body":"I believe you need to have only the line\n\n*.el diff=el\n\nin the .gitattributes file.\n\nThe part\n\n[diff = \"el\"]\n   xfuncname = ...\n\nhas to be in the git config file. The .git/config file would do for this.\n\n\nOn Mon, Apr 6, 2009 at 2:39 PM, David Abrahams <dave@boostpro.com> wrote:\n>\n> On Apr 3, 2009, at 9:45 PM, Jeff King wrote:\n>\n>> On Fri, Apr 03, 2009 at 09:10:42PM -0400, David Abrahams wrote:\n>>\n>>> Please see\n>>> http://github.com/techarcana/elisp/commit/63d672c296316c85690085930b05c642b88a9978#diff-2\n>>>\n>>> Note how the @@ ... @@ clauses are followed by text from the previous\n>>> line's comment.  Not sure, but this strikes me as a line-ending issue.\n>>> custom.el was originally built on a linux machine; now I'm using a Mac.\n>>\n>> This is as designed. The original file (\"git show e7dd7db\") contains (my\n>> numbering seems different than what git produces; it is produced by \"nl\"\n>> which is maybe treating some line endings differently earlier in the\n>> file):\n>>\n>>  102   '(mm-attachment-override-types (quote (\"text/x-vcard\" \"application/pkcs7-mime\" \"application/x-pkcs7-mime\" \"application/pkcs7-signature\" \"application/x-pkcs7-signature\" \"image/*\")) nil nil \"\n>>  103  Added image/* to display attached images inline\")\n>>  104   '(mm-discouraged-alternatives (quote (\"text/html\" \"text/richtext\" \"image/.*\")) nil nil \"\n>>  105  The documentation for this variable says it all\")\n>>  106   '(mm-inline-text-html-with-images t)\n>>  107   '(muse-project-alist (quote ((\"WikiPlanner\" (\"~/plans\" :default \"index\" :major-mode planner-mode :visit-link planner-visit-link)))))\n>>  108   '(org-agenda-files (quote (\"~/organizer.org\")))\n>>\n>> The changed text in your diff starts on 108. So we show 105-107 as\n>> context lines. The text after the @@ clause is the \"function header\";\n>> this is equivalent to \"-p\" in GNU diff. It's basically a guess about the\n>> most interesting context to show, and looks alphabetic characters that\n>> are left-aligned. In the case of lisp, it really isn't all that\n>> interesting (and what looks so weird is that your file contains\n>> a lot of\n>>\n>>  \"\\nSome text\"\n>>\n>> so the text strings are all left-aligned. You can customize the regex\n>> used to guess at the function header. See \"defining a custom\n>> hunk-header\" in \"git help attributes\".\n>\n> Hmm, so I tried sticking this .gitattributes in my repo\n>\n>  *.el   diff=el\n>  [diff \"el\"]\n>        xfuncname = \"^(\\\\(def[a-z]+ .+)$\"\n>\n> and git diff barfed with\n>\n>  \"el\"] is not a valid attribute name: .gitattributes:2\n>  \"^(\\\\(def[a-z]+ is not a valid attribute name: .gitattributes:3\n>\n> What am I missing?  I tried googling, but from what turns up for me, it doesn't look like anyone else has ever tried to use this feature!\n>\n> TIA,\n>\n> --\n> David Abrahams\n> BoostPro Computing\n> http://boostpro.com\n>\n>\n>\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"}]}