Skip to content

%(head) is empty when starting tig with branch name given #1366

@ds82

Description

@ds82

I have this binding to start a code review in neovim directly from the selected commit in tig:

bind main v !>nvim +'DiffviewOpen %(commit)~1..%(head)' 

Thing is .. that only works if the branch I want to review is currently checked out or if I use tig -> view-refs, select the branch and commit and then use the keybind.

If I start tig with a branch directly, e.g. tig origin/some/branch and select a commit, the %(head) variable contains the wrong commit (the one of the currently checked out branch, not the branch I called tig with).

Edit: I also tried %(branch) and %(refname) but they wont work either.

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