git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Jason Pyeron" <jpyeron@pdinc.us>
To: <git@vger.kernel.org>
Subject: Blame / annotate with mixed mac line endings?
Date: Wed, 2 May 2018 19:57:28 -0400	[thread overview]
Message-ID: <B8114616E07247C7A78F1DFF91E16A63@ad.pdinc.us> (raw)

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  |<!---.xxxxxxxx: |
00000010  78 78 78 5f 78 78 78 2e  78 78 78 0d 78 78 78 78  |xxx_xxx.xxx.xxxx|
00000020  78 78 3a 0d 78 78 78 78  78 78 78 3a 20 38 38 2f  |xx:.xxxxxxx: 88/|
00000030  38 38 2f 38 38 38 38 20  38 38 3a 38 38 3a 38 38  |88/8888 88:88:88|
00000040  20 78 78 0d 78 78 78 78  78 78 78 78 3a 20 38 38  | xx.xxxxxxxx: 88|
00000050  2f 38 38 2f 38 38 38 38  20 38 38 3a 38 38 3a 38  |/88/8888 88:88:8|
00000060  38 20 78 78 0d 78 78 78  78 78 78 78 78 78 78 78  |8 xx.xxxxxxxxxxx|
00000070  3a 0d 2d 2d 2d 3e 0d 0d  3c 78 78 78 78 78 78 20  |:.--->..<xxxxxx |
00000080  78 78 78 78 3d 22 78 78  78 5f 78 78 78 5f 78 78  |xxxx="xxx_xxx_xx|
00000090  78 78 22 20 78 78 78 78  3d 22 38 22 20 78 78 78  |xx" xxxx="8" xxx|
000000a0  78 78 78 78 78 3e 0d 0a  09 3c 78 78 78 78 78 78  |xxxxx>...<xxxxxx|
000000b0  20 78 78 78 78 78 3d 22  22 3e 2d 20 78 78 78 78  | xxxxx="">- 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>...<xxxx|
000000e0  20 78 78 78 2e 78 78 78  78 78 78 78 78 78 78 20  | xxx.xxxxxxxxxx |
000000f0  78 78 78 20 38 20 78 78  20 78 78 78 78 2e 78 78  |xxx 8 xx xxxx.xx|
00000100  78 78 78 78 78 78 78 20  78 78 20 27 78 78 38 78  |xxxxxxx xx 'xx8x|
00000110  27 3e 0d 0a 09 3c 78 78  78 78 78 78 20 78 78 78  |'>...<xxxxxx xxx|
00000120  78 78 3d 22 3c 78 78 78  78 78 78 78 78 20 78 78  |xx="<xxxxxxxx xx|
00000130  78 78 78 3d 22 78 78 78  78 78 78 78 78 78 78 22  |xxx="xxxxxxxxxx"|
00000140  3e 23 78 78 78 5f 78 78  78 23 2c 3c 2f 78 78 78  |>#xxx_xxx#,</xxx|
00000150  78 78 78 78 78 3e 78 78  78 22 3e 78 78 78 3c 2f  |xxxxx>xxx">xxx</|
00000160  78 78 78 78 78 78 3e 0d  0a 09 3c 2f 78 78 78 78  |xxxxxx>...</xxxx|
00000170  3e 0d 0a 3c 78 78 78 78  78 78 78 78 20 78 78 78  |>..<xxxxxxxx xxx|
00000180  78 78 3d 22 78 78 78 78  78 78 78 78 78 78 22 3e  |xx="xxxxxxxxxx">|
00000190  0d 0a 09 3c 78 78 78 78  78 78 20 78 78 78 78 78  |...<xxxxxx xxxxx|
000001a0  3d 22 23 78 78 78 5f 78  78 78 23 22 3e 23 78 78  |="#xxx_xxx#">#xx|
000001b0  78 5f 78 78 78 23 3c 2f  78 78 78 78 78 78 3e 0d  |x_xxx#</xxxxxx>.|
000001c0  0a 3c 2f 78 78 78 78 78  78 78 78 3e 0d 0a 3c 2f  |.</xxxxxxxx>..</|
000001d0  78 78 78 78 78 78 3e 0d  0a 0d 0a                 |xxxxxx>....|
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   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


             reply	other threads:[~2018-05-03  0:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02 23:57 Jason Pyeron [this message]
2018-05-03  1:22 ` Blame / annotate with mixed mac line endings? Junio C Hamano
2018-05-03  2:32   ` Jason Pyeron
2018-05-03  4:55     ` Junio C Hamano

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=B8114616E07247C7A78F1DFF91E16A63@ad.pdinc.us \
    --to=jpyeron@pdinc.us \
    --cc=git@vger.kernel.org \
    /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).