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

Git console doesn't open when hook fails #1652

Open
pipoprods opened this issue Feb 6, 2025 · 0 comments
Open

Git console doesn't open when hook fails #1652

pipoprods opened this issue Feb 6, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@pipoprods
Copy link

pipoprods commented Feb 6, 2025

Description

Hi,

The Git console doesn't open when a hook fails. There's no user feedback at all indicating something failed.

Example minimal git hook provided in minimal config section.

Neovim version

NVIM v0.10.4
Build type: Release
LuaJIT 2.1.1713484068

Operating system and version

Debian 12

Steps to reproduce

  1. nvim -u ./minimal.lua
  2. add files to stage
  3. try to commit
  4. nothing happens (normal), no message is displayed

Expected behavior

The console should auto-open to let the user see the hook output.

Actual behavior

The hook output is not displayed.

Minimal config

Minimal setup:

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
	vim.fn.system({
		"git",
		"clone",
		"--filter=blob:none",
		"https://github.com/folke/lazy.nvim.git",
		"--branch=stable", -- latest stable release
		lazypath,
	})
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
	"NeogitOrg/neogit",
	dependencies = {
		"nvim-lua/plenary.nvim", -- required
		"nvim-telescope/telescope.nvim", -- optional
		"sindrets/diffview.nvim", -- optional
	},
	config = function()
		require("neogit").setup({})
	end,
})

.git/hooks/commit-msg:

#!/bin/sh

echo "Hook failed"
exit 1
@pipoprods pipoprods added the bug Something isn't working label Feb 6, 2025
@pipoprods pipoprods changed the title Git console doesn't open when fails Git console doesn't open when hook fails Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant