Comments (8)
I think the problem is caused by this line:
When file
is empty, then fnamemodify(file, ':p')
returns the full path of the cwd. This means that in some cases this can end up being wrongly set as dotgit
instead of dir
, which makes git-messenger fail with the "not in a git repo" error.
Changing the line to:
let file = empty(file) ? '' : fnamemodify(file, ':p')
fixes this for me, but I haven't verified if this still works for the submodules case (which I think is the reason why this was introduced). Maybe a similar check should be done for let dir = fnamemodify(dir, ':p')
too.
from git-messenger.vim.
Closing as I could confirm the fix.
from git-messenger.vim.
I was working on another PR which just browse up till oblivion. But Iām fully new to vimscript , and I have no idea how to have the same behavior In Windows world. @rafikdraoui ās seems like a much better option.
from git-messenger.vim.
@rhysd could you fix this?
Could @rafikdraoui solution do the trick?
Great plugin btw!
from git-messenger.vim.
I'm sorry for the delay. I was fixing critical issue at github-action-benchmark and prioritized moving CI to GitHub Actions.
I'm not reproducing this issue, but @rafikdraoui's comment looks helpful. I'll try to fix this.
from git-messenger.vim.
@ylmrx @MeisterTea @rafikdraoui Since I'm not understanding how to reproduce this, would you check 422a933 fixed this issue?
from git-messenger.vim.
I can confirm that 422a933 fixes this for me. Thanks!
Here's how I can reproduce the bug with commit d238582 (the one just before the fix). I don't have time to test with a minimal config (i.e. perhaps my vimrc or other plugins are interfering) or with vanilla vim, but maybe this could still be helpful:
$ git clone [email protected]:rhysd/git-messenger.vim.git
$ cd git-messenger.vim
$ nvim autoload/gitmessenger.vim
Then inside NeoVim:
:GitMessenger " this works
:cd autoload
:GitMessenger " this doesn't work
from git-messenger.vim.
@rafikdraoui Thank you for the detailed steps. It is very helpful for me. I also could confirm this issue was fixed by 422a933 on my local machine. I did not notice this issue because I usually set the current directory to a root of repository. I think I should add more test case to confirm relative paths work properly.
from git-messenger.vim.
Related Issues (20)
- Question about autocmd on float window HOT 4
- [Feature Request] View word-diff version of commit HOT 2
- Git on CentOS7 does not work because it does not support -C option HOT 5
- Does not detect symlinks HOT 4
- Inside .github directory is detected as inside .git directory
- Lines starting with '-' are highlighted as 'removed' in word diffs
- [Question] Missing tests for word-diff feature HOT 3
- Add highlight border color variable HOT 7
- [Idea] Open github pull request of commit HOT 3
- popup commit body sometimes shows CRLF ^M HOT 10
- View range log
- E21: Cannot make changes, 'modifiable' is off HOT 3
- Does not resolve symlink before searching for git root
- Doesn't work on worktrees HOT 2
- Autoclose on BufLeave should be only when entering into a normal buffer HOT 2
- Git popup in visual mode on "<"
- expose command to customise git diff
- vim support popup_create ļ¼
- The bottom border is gone after I press r or d
- Highlight glitch if I press r followed by d
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-messenger.vim.