NeogitOrg / NeogitOrg/neogit

codediff integration broken by codediff.nvim 2.67.9 SessionConfig changes: "attempt to index local 'ref'"

Open
#2,008 2 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
5.6k
Forks
357
Avg merge
15h 47m
Merged PRs (30d)
2

Description

Problem

Every entry point that opens codediff from neogit crashes, e.g. pressing
dd on a commit in a log buffer:

vim.schedule callback: .../codediff.nvim/lua/codediff/ui/view/helpers.lua:54:
attempt to index local 'ref' (a nil value)
stack traceback:
        .../codediff.nvim/lua/codediff/ui/view/helpers.lua:54: in function 'prepare_buffer'
        .../codediff.nvim/lua/codediff/ui/view/side_by_side.lua:98: in function 'open_diff_panes'
        .../codediff.nvim/lua/codediff/ui/view/side_by_side.lua:336: in function 'create'
        .../neogit/lua/neogit/integrations/codediff.lua:86: in function 'open_explorer'
        .../neogit/lua/neogit/integrations/codediff.lua:110: in function <...:109>

Environment

  • neogit: master (5adc81b2)
  • codediff.nvim: >= 2.67.9 (breaking change introduced in b263f54,
    "refactor(session): fold the panel object into the panel descriptor")

Reproduce

  1. diff_viewer = "codediff" (or auto-detected with codediff.nvim installed)
  2. Open any log buffer (NeogitLogCurrent / Neogit log)
  3. Press dd on a commit

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lua/neogit/integrations/codediff.lua, especially open_explorer around the reported line, and compare the arguments it passes with codediff.nvim's SessionConfig changes from b263f54. Reproduce with codediff enabled by opening a log buffer and pressing dd on a commit; done means each codediff entry point opens without the nil ref error.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, lua
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.