Skip to content

Use correct line when using :parent in blame view #1372

Merged
koutcher merged 2 commits intojonas:masterfrom
ilyagr:fix-comma-blame
Apr 11, 2025
Merged

Use correct line when using :parent in blame view #1372
koutcher merged 2 commits intojonas:masterfrom
ilyagr:fix-comma-blame

Conversation

@ilyagr
Copy link
Copy Markdown
Contributor

@ilyagr ilyagr commented Mar 22, 2025

@krobelus observed in #1370 that this behavior, fixed in ca0809d, regressed again in 2280734.

This bug is similar to, but not identical with, #1369.

The easiest way to observe the bug is to run tig blame +28 tig-2.5.12 -- src/diff.c and press , AKA :parent. The problem is that the view stays on line 28 instead of jumping to the corresponding line.


This PR is complementary with #1370, they fix different bugs and can be merged independently. We could also decide on a different solution of changing the meaning of blame->line. That would also require a change to #1370.

See #1370 (comment) and the following comment for more details

A lot of this work is based heavily on that of @krobelus; the test is almost an exact copy of the test from #1370 for example.

@ilyagr ilyagr force-pushed the fix-comma-blame branch 3 times, most recently from c2bfc10 to 5001878 Compare March 22, 2025 04:36
@krobelus observed in jonas#1370 that this
behavior, fixed in ca0809d, regressed again in 2280734.

This bug is similar to, but not identical with,
jonas#1369.

The easiest way to observe the bug is to run `tig blame +28 tig-2.5.12
-- src/diff.c` and press `,` AKA `:parent`. The problem is that the view
stays on line 28 instead of jumping to the corresponding line.

The test is almost an exact copy of the test by @krobelus
from jonas#1370.
This fixes the bug described in the parent commit.

`blame->lineno` is only used here and in jonas#1370, so
we can either do this or we could shift all the
entries in `blame->lineno` by 1.
@koutcher koutcher merged commit 1ece6ae into jonas:master Apr 11, 2025
9 checks passed
@ilyagr ilyagr deleted the fix-comma-blame branch April 11, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants