sindrets / diffview.nvim

Single tabpage interface for easily cycling through diffs for all modified files for any git rev.
Other
3.85k stars 105 forks source link

How to use with yadm? #296

Closed oblitzitate closed 1 year ago

oblitzitate commented 1 year ago

I tried :DiffviewOpen -C~/.local/share/yadm/repo.git but got the following error:

Error executing Lua callback: ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:131: attempt to concatenate field 'dir' (a nil value)                                                               
stack traceback:                                                                                                                                                                                              
        ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:131: in function 'post_open'                                                                                                              
        ...hare/nvim/lazy/diffview.nvim/lua/diffview/scene/view.lua:71: in function 'open'                                                                                                                    
        ...ocal/share/nvim/lazy/diffview.nvim/lua/diffview/init.lua:115: in function 'open'                                                                                                                   
        ....local/share/nvim/lazy/diffview.nvim/plugin/diffview.lua:24: in function <....local/share/nvim/lazy/diffview.nvim/plugin/diffview.lua:23> 

I'm thinking I need to assign the work-tree but don't know if I can do that.

sindrets commented 1 year ago

It isn't supposed to throw an error either way, so thanks for reporting. That part should be fixed now.

You're maybe correct in that you have to specify the working tree path. That is, only if YADM doesn't configure a default working tree path. What you definitely must specify for bare git repos is the path to the git directory. Git is not able to figure this out from the path alone for bare repos.

Define the GIT_DIR environment variable such that it points to the repo.git directory.

Closing as a duplicate of #237.