git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git diff bug?

From
APAntriksh Pany <antriksh.pany@gmail.com>
Date
Apr 7, 2009, 18:25 UTC
Message-ID
<e6cd6cf90904071125m3009c34dv9b9c037a98983405@mail.gmail.com>
In-Reply-To
<1BF9172A-BE91-4D1C-932A-EB9FD79BA402@boostpro.com>
I believe you need to have only the line
*.el diff=el
in the .gitattributes file.
The part
[diff = "el"]
   xfuncname = ...
has to be in the git config file. The .git/config file would do for this.
On Mon, Apr 6, 2009 at 2:39 PM, David Abrahams <dave@boostpro.com> wrote:
Show 66 quoted lines
>
> On Apr 3, 2009, at 9:45 PM, Jeff King wrote:
>
>> On Fri, Apr 03, 2009 at 09:10:42PM -0400, David Abrahams wrote:
>>
>>> Please see
>>> http://github.com/techarcana/elisp/commit/63d672c296316c85690085930b05c642b88a9978#diff-2
>>>
>>> Note how the @@ ... @@ clauses are followed by text from the previous
>>> line's comment.  Not sure, but this strikes me as a line-ending issue.
>>> custom.el was originally built on a linux machine; now I'm using a Mac.
>>
>> This is as designed. The original file ("git show e7dd7db") contains (my
>> numbering seems different than what git produces; it is produced by "nl"
>> which is maybe treating some line endings differently earlier in the
>> file):
>>
>>  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 "
>>  103  Added image/* to display attached images inline")
>>  104   '(mm-discouraged-alternatives (quote ("text/html" "text/richtext" "image/.*")) nil nil "
>>  105  The documentation for this variable says it all")
>>  106   '(mm-inline-text-html-with-images t)
>>  107   '(muse-project-alist (quote (("WikiPlanner" ("~/plans" :default "index" :major-mode planner-mode :visit-link planner-visit-link)))))
>>  108   '(org-agenda-files (quote ("~/organizer.org")))
>>
>> The changed text in your diff starts on 108. So we show 105-107 as
>> context lines. The text after the @@ clause is the "function header";
>> this is equivalent to "-p" in GNU diff. It's basically a guess about the
>> most interesting context to show, and looks alphabetic characters that
>> are left-aligned. In the case of lisp, it really isn't all that
>> interesting (and what looks so weird is that your file contains
>> a lot of
>>
>>  "\nSome text"
>>
>> so the text strings are all left-aligned. You can customize the regex
>> used to guess at the function header. See "defining a custom
>> hunk-header" in "git help attributes".
>
> Hmm, so I tried sticking this .gitattributes in my repo
>
>  *.el   diff=el
>  [diff "el"]
>        xfuncname = "^(\\(def[a-z]+ .+)$"
>
> and git diff barfed with
>
>  "el"] is not a valid attribute name: .gitattributes:2
>  "^(\\(def[a-z]+ is not a valid attribute name: .gitattributes:3
>
> 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!
>
> TIA,
>
> --
> David Abrahams
> BoostPro Computing
> http://boostpro.com
>
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: David Abrahams
Message 13 of 13 in “git diff bug?”
  1. David AbrahamsApr 4, 2009
  2. Jeff KingApr 4, 2009
  3. Jeff KingApr 4, 2009
  4. David AbrahamsApr 6, 2009
  5. Michael J GruberApr 6, 2009
  6. David AbrahamsApr 6, 2009
  7. Jeff KingApr 6, 2009
  8. Jeff KingApr 6, 2009
  9. Matthieu MoyApr 6, 2009
  10. Junio C HamanoApr 6, 2009
  11. Matthieu MoyApr 6, 2009
  12. David AbrahamsApr 6, 2009
  13. Antriksh PanyApr 7, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.