Thread (5 messages) flat view 5 messages, 3 authors, 2016-06-15

Re: [PATCH] blame: make sure that the last line ends in an LF

From: Sverre Rabbelier <hidden>
Date: 2016-06-15 22:47:35

Possibly related (same subject, not in this thread)

Heya,

On Tue, Oct 20, 2009 at 11:55, Junio C Hamano [off-list ref] wrote:
That is kind of surprising ;-) as I do remember that I never thought about
this issue of dealing with the incomplete lines while writing the blame
algorithm.  I actually didn't even think about "well this will not work
because I am ignoring the incomplete lines".
I used the following repo for testing:

$ git init
Initialized empty Git repository in /home/sverre/code/test/.git/
$ echo "first line" > test
$ git add test
$ git commit -m "initial"
[master (root-commit) d573d06] initial
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 test
$ echo -n "second line, no newline" >> test
$ git add test
$ git commit -m "second"
[master 76ad2f9] second
 1 files changed, 1 insertions(+), 0 deletions(-)

Regular output looks good:

$ git blame test
^d573d06 (Sverre Rabbelier 2009-10-20 12:30:56 -0500 1) first line
76ad2f90 (Sverre Rabbelier 2009-10-20 12:31:57 -0500 2) second line, no newline

Porcelain output looks good too:

$ git blame -p test
d573d06f0dd50148ba8e59bf8f1ef8fa7ee9fc88 1 1 1
author Sverre Rabbelier
author-mail [off-list ref]
author-time 1256059856
author-tz -0500
committer Sverre Rabbelier
committer-mail [off-list ref]
committer-time 1256059856
committer-tz -0500
summary initial
boundary
filename test
        first line
76ad2f90bde689a65715e37afd37d45942c74954 2 2 1
author Sverre Rabbelier
author-mail [off-list ref]
author-time 1256059917
author-tz -0500
committer Sverre Rabbelier
committer-mail [off-list ref]
committer-time 1256059917
committer-tz -0500
summary second
previous d573d06f0dd50148ba8e59bf8f1ef8fa7ee9fc88 test
filename test
        second line, no newline

-- 
Cheers,

Sverre Rabbelier
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help