Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit subjects starting with vim: cause an error when running :G #2333

Closed
zivarah opened this issue Aug 27, 2024 · 1 comment · Fixed by #2335
Closed

Commit subjects starting with vim: cause an error when running :G #2333

zivarah opened this issue Aug 27, 2024 · 1 comment · Fixed by #2335

Comments

@zivarah
Copy link

zivarah commented Aug 27, 2024

Description

I've noticed that on certain branches, :G shows an error referencing modelines and then some word from the subject of a commit that will show in the status buffer. It seems to occur whenever the message starts with vim:, which is a prefix I use (akin to conventional commits) in my dotfiles repo when making a change to anything vim-related.

The error message is:

Error detected while processing modelines:
line    6:
E518: Unknown option: pin
Press ENTER or type command to continue

where "pin" is the word after the : in the subject.

Minimal configuration

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    {
      "tpope/vim-fugitive",
      config = function() end,
      commit = "0444df68cd1cdabc7453d6bd84099458327e5513",
    },
  },
})

Steps to reproduce

  1. Set up a git repo and branch that will show a commit with the subject "vim: pin which-key to v2.1.0" when viewed in the status buffer:

    git init --initial-branch=main repro
    cd repro
    git commit --allow-empty -m "initial commit"
    git switch -c feature main
    git branch --set-upstream-to main
    git commit --allow-empty -m "vim: pin which-key to v2.1.0"
    
  2. Run nvim -u <path-to-minimal-config> from the reproduction repo

  3. Run :G, the error should show

  4. Press enter and see that the status buffer does still load (though I have issues with bindings afterwards)

Details

The error only seems to occur when the status buffer is not currently visible, and only when the message starts with vim:. For example, if I change the message in the above reproduction to omit the : (vim pin which-key to v2.1.0), the error no longer occurs. If I change it to just vim: a, the error still occurs. If I change it to nvim: a, the error does not occur again.

The status buffer does still load, but it seems that the various custom bindings I have for the status buffer are not applied.

Specs/setup

OS: MacOS Sonoma 14.6.1
Fugitive: 0444df6 (Use nvim vim.ui.open as a fallback, 2024-07-18)
Git: v2.46.0
Vim: Neovim v0.10.1

Also reproduced in NixOS 24.05 with Neovim v0.9.5 and git v2.44.1.

@zivarah
Copy link
Author

zivarah commented Aug 27, 2024

A bisect shows that this issue was introduced by 8c8cdf4 (Use callback based workflow for status buffer, 2024-02-11).

julio-b added a commit to julio-b/vim-fugitive that referenced this issue Sep 2, 2024
Regression introduced in 8c8cdf4.
Resolves: tpope#2333
@tpope tpope closed this as completed in 1d18c69 Sep 2, 2024
jcarlos7121 pushed a commit to jcarlos7121/vim-fugitive that referenced this issue Jan 31, 2025
Regression introduced in 8c8cdf4.
Resolves: tpope#2333
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant