Skip to content

blame: The b key in blame view does not go to the correct line since ca0809dbd #1369

@ilyagr

Description

@ilyagr

To reproduce, run tig blame +28 tig-2.5.12 -- src/diff.c in the tig repo with tig 2.5.12, and then press b. This takes me to line 28 of commit a1894.

This is incorrect. The correct behavior would take me to the corresponding line 54 of commit a1894.

That is because line 28 of tig-2.5.12 is const char *diff_argv[] = { and the blame commit is a1894.The corresponding line in commit a1894 is line 54 (and not line 28).

I bisected this; the behavior was correct until commit ca0809d which broke it (while fixing #973).

Cc @krobelus if you are interested.

With some pointers, I might be able to help fixing it, but it worries me that fixing this bug might break another behavior.


I don't think it's relevant (Update: the bug is unchanged by setting GIT_CONFIG=/dev/null, so it's not relevant), but here is the tig-related portion of my gitconfig:

[tig]
mouse=true
refresh-mode=periodic
refresh-interval=3
main-view-date-display=relative-compact
main-view-id-display=true
blame-view=author:abbreviated date:relative-compact id:yes,color line-number:yes,interval=1 text
# Tig always shows "author dates" instead of "commit dates",
# making reflog dates are very confusing
reflog-view-date-display=relative
# Don't show refs made by `jj`, `git-branchless`, etc.
reference-format=hide:other

[tig "color"]
# cursor = default default underline
cursor = default default reverse dim
# cursor = black white

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions