From: Jason Pyeron Date: Wed, 02 May 2018 23:57:28 GMT Subject: Blame / annotate with mixed mac line endings? Message-ID: I think this file may have been from a mac at one point. Note the lone CR (0x0d) line endings, with CRLFs later. $ cat src/htdocs/hr/ats/rpts/incl/slt_org.cfm | sed 's/[a-zA-Z]/x/g;s/[0-9]/8/g' | hexdump -C 00000000 3c 21 2d 2d 2d 0d 78 78 78 78 78 78 78 78 3a 20 |.....- xxxx| 000000c0 78 78 20 78 78 78 20 78 78 20 78 78 78 78 2d 3c |xx xxx xx xxxx-<| 000000d0 2f 78 78 78 78 78 78 3e 0d 0a 09 3c 78 78 78 78 |/xxxxxx>......#xxx_xxx#,xxx">xxx.....| 00000190 0d 0a 09 3c 78 78 78 78 78 78 20 78 78 78 78 78 |...#xx| 000001b0 78 5f 78 78 78 23 3c 2f 78 78 78 78 78 78 3e 0d |x_xxx#.| 000001c0 0a 3c 2f 78 78 78 78 78 78 78 78 3e 0d 0a 3c 2f |.......| 000001db $ git annotate -L 13,17 --line-porcelain 'src/htdocs/hr/ats/rpts/incl/slt_org.cfm' fatal: file src/htdocs/hr/ats/rpts/incl/slt_org.cfm has only 10 lines $ cat src/htdocs/hr/ats/rpts/incl/slt_org.cfm | wc -l 10 $ cat src/htdocs/hr/ats/rpts/incl/slt_org.cfm | mac2unix | wc -l 18 $ git -c core.autocrlf=false -c core.eol=cr annotate -L 13,17 --line-porcelain 'src/htdocs/hr/ats/rpts/incl/slt_org.cfm' fatal: file src/htdocs/hr/ats/rpts/incl/slt_org.cfm has only 10 lines Any way to hit git with a stick to treat lone CR as a line break for blame/annotate? -Jason -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Principal Consultant 10 West 24th Street #100 - - +1 (443) 269-1555 x333 Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-