RE: Blame / annotate with mixed mac line endings?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----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@xxxxxxxx> 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   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux