Noam Postavsky <[email protected]>
writes:

> Sorry, hit reply instead of reply-all; resending to list.
>
> On Fri, Aug 22, 2014 at 10:10 AM, Thorsten Jolitz
> <[email protected]> wrote:
>>
>> Lately I see this using (ma)git on (uncompiled) emacs-lisp files (.el
>> extension):
>
> To be clear, this happens with git from the command line, not just
> magit? 

,----
| [tj@arch foo]$ git diff
| diff --git a/src/foo.el b/src/foo.el
| index 4fd4832..600937e 100644
| Binary files a/src/foo.el and b/src/foo.el differ
`----

> Do you have any NUL characters in your file? 

Ah, I think thats it!

foo.el and other libraries of mine contains regexps with a technique I
stole from the Org developers: match every possible char with

,----
| "[^^@]+" 
`----

with ^@ being the NULL character entered with C-q. I've seen other
variations of this, but this one works really reliably for me. At a
cost, it seems ... 

> I think adding
>
>     *.el diff
>
> to your ~/.gitattributes file should avoid the problem. Or even better
>
>     *.el diff=lisp
>
> and add this to your ~/.gitconfig:
>
>     [diff "lisp"]
>         xfuncname = "^\\(.*$"
> That way you get nicer headers for your lisp diffs.

ok, done, guess I should restart emacs now. 

> See http://git-scm.com/docs/gitattributes for details.

Thanks for your tips!

-- 
cheers,
Thorsten

-- 
You received this message because you are subscribed to the Google Groups 
"magit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to