You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that "Move to parent" (',' key) in tig blame doesn't set the line position appropriately.
% git init
Initialized empty Git repository in /tmp/h/.git/
% print -l a a a b foo c d d d d d d d d d d d d d d > file
% cat file
a
a
a
b
foo
c
d
d
d
d
d
d
d
d
d
d
d
d
d
d
% git add file; git commit -m 'initial file'
[master (root-commit) 54a3b91] initial file
1 file changed, 20 insertions(+)
create mode 100644 file
% print -l a a a a a a a a a a a b bar c > file
% cat file
a
a
a
a
a
a
a
a
a
a
a
b
bar
c
% git add file ; git commit -m 'modified file'
[master e693734] modified file
1 file changed, 9 insertions(+), 15 deletions(-)
% strace -s 2000 -f -o log /home/src/tig/bin/tig blame file
Then, tig shows following screen.
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 1│ a
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 2│ a
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 3│ a
e693734 Tanaka Akira 2019-11-29 20:59 +0900 4│ a
e693734 Tanaka Akira 2019-11-29 20:59 +0900 5│ a
e693734 Tanaka Akira 2019-11-29 20:59 +0900 6│ a
e693734 Tanaka Akira 2019-11-29 20:59 +0900 7│ a
e693734 Tanaka Akira 2019-11-29 20:59 +0900 8│ a
e693734 Tanaka Akira 2019-11-29 20:59 +0900 9│ a
e693734 Tanaka Akira 2019-11-29 20:59 +0900 10│ a
e693734 Tanaka Akira 2019-11-29 20:59 +0900 11│ a
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 12│ b
e693734 Tanaka Akira 2019-11-29 20:59 +0900 13│ bar <------ press "," here
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 14│ c
I pressed "," (Move to parent) at "bar" line as I noted as above.
Then tig shows follows.
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 1│ a
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 2│ a
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 3│ a
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 4│ b
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 5│ foo
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 6│ c
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 7│ d
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 8│ d
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 9│ d
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 10│ d
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 11│ d
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 12│ d
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 13│ d <------- cursor here
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 14│ d
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 15│ d
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 16│ d
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 17│ d
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 18│ d
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 19│ d
54a3b91 Tanaka Akira 2019-11-29 20:59 +0900 20│ d
The cursor line is set at the line 13 as I noted as above.
I intended to change the line "foo" to "bar",
the cursor should be positioned at the line 5.
It seems tig determine the line position in parent commit using git diff -U0
(The function setup_blame_parent_line in src/blame.c).
I found that "Move to parent" (',' key) in tig blame doesn't set the line position appropriately.
Then, tig shows following screen.
I pressed "," (Move to parent) at "bar" line as I noted as above.
Then tig shows follows.
The cursor line is set at the line 13 as I noted as above.
I intended to change the line "foo" to "bar",
the cursor should be positioned at the line 5.
It seems tig determine the line position in parent commit using git diff -U0
(The function setup_blame_parent_line in src/blame.c).
I checked git diff command invoked by tig.
It seems git diff correctly found my intention, "foo" is changed to "bar".
So, I think the current behavior is not intentional.
I compiled tig today.
The text was updated successfully, but these errors were encountered: