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

RE: Blame / annotate with mixed mac line endings?

From
Jason Pyeron <jpyeron@pdinc.us>
Date
May 3, 2018, 02:32 UTC
Message-ID
<8957C3B9BEF94443ABE0A67340786A86@ad.pdinc.us>
In-Reply-To
<xmqqh8npv8hy.fsf@gitster-ct.c.googlers.com>
Show 9 quoted lines
> -----Original Message-----
> From: Junio C Hamano
> Sent: Wednesday, May 2, 2018 21:22
> Subject: Re: Blame / annotate with mixed mac line endings?
> 
> "Jason Pyeron" <jpyeron@pdinc.us> writes:
> 
> > Any way to hit git with a stick to treat lone CR as a line 
> break for blame/annotate?
> I highly suspect that you would get more help from those whose love
> is Git if your inquiry were about a way to ask Git politely to do
> what you want to achieve, rather than hitting it with a stick ;-)
No offense meant.
> Perhaps define a textconv filter to fix the incorrect line endings?
Worked perfectly! I Read:
https://github.com/git/git/blob/master/t/t8006-blame-textconv.sh
Added to .git/config:
[diff "test"]
        textconv = /usr/local/bin/helper.sh

Added to .gitattributes: *.cfm diff=test

$ cat /usr/local/bin/helper.sh cat "$1" | mac2unix

The important issue was to not use mac2unix directly, because it modifies the file itself.
Read: https://git.wiki.kernel.org/index.php/Textconv but it did not help so much.
Thanks,
Jason
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “Blame / annotate with mixed mac line endings?”
  1. Jason PyeronMay 2, 2018
  2. Junio C HamanoMay 3, 2018
  3. Jason PyeronMay 3, 2018
  4. Junio C HamanoMay 3, 2018

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.