git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: David Abrahams <dave@boostpro.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: git diff bug?
Date: Mon, 6 Apr 2009 05:09:32 -0400	[thread overview]
Message-ID: <1BF9172A-BE91-4D1C-932A-EB9FD79BA402@boostpro.com> (raw)
In-Reply-To: <20090404014527.GA13350@coredump.intra.peff.net>


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

  parent reply	other threads:[~2009-04-06  9:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-04  1:10 git diff bug? David Abrahams
2009-04-04  1:45 ` Jeff King
2009-04-04  1:52   ` Jeff King
2009-04-06  9:09   ` David Abrahams [this message]
2009-04-06 14:44     ` Michael J Gruber
2009-04-06 17:58       ` David Abrahams
2009-04-06 18:48         ` Jeff King
2009-04-06 15:53     ` Jeff King
2009-04-06 17:37       ` Matthieu Moy
2009-04-06 17:56         ` Junio C Hamano
2009-04-06 19:32           ` Matthieu Moy
2009-04-06 18:16       ` David Abrahams
2009-04-07 18:25     ` Antriksh Pany
  -- strict thread matches above, loose matches on Subject: below --
2013-06-06 21:26 Sarma Tangirala
2013-06-06 21:42 ` Célestin Matte
2013-06-06 22:17   ` Junio C Hamano
2013-06-07 16:01     ` Sarma Tangirala
2013-06-10 12:44       ` Célestin Matte
2013-06-10 14:41         ` Sarma Tangirala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1BF9172A-BE91-4D1C-932A-EB9FD79BA402@boostpro.com \
    --to=dave@boostpro.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).