From 436b3bfe522642e15cb61d3c0863c77ad8f1510b Mon Sep 17 00:00:00 2001 From: jinzhongjia Date: Mon, 22 Dec 2025 13:16:04 +0800 Subject: [PATCH] fix(gitcommit): remove caret from log range Verify .git directory and remove deps/mini.nvim before cloning. --- lua/codecompanion/_extensions/gitcommit/tools/command.lua | 2 +- mise.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/codecompanion/_extensions/gitcommit/tools/command.lua b/lua/codecompanion/_extensions/gitcommit/tools/command.lua index 8aa23c8..400f446 100644 --- a/lua/codecompanion/_extensions/gitcommit/tools/command.lua +++ b/lua/codecompanion/_extensions/gitcommit/tools/command.lua @@ -442,7 +442,7 @@ end ---@param to_tag string Ending tag ---@return string command function CommandBuilder.release_notes_log(from_tag, to_tag) - local range = from_tag .. "^.." .. to_tag + local range = from_tag .. ".." .. to_tag local escaped_range = vim.fn.shellescape(range) local format_str = shell_quote("%h\x01%s\x01%an\x01%ad") return "git log --pretty=format:" .. format_str .. " --date=short " .. escaped_range diff --git a/mise.toml b/mise.toml index 2ee0148..c7dcaf1 100644 --- a/mise.toml +++ b/mise.toml @@ -14,11 +14,11 @@ windows_default_inline_shell_args = "pwsh -NoProfile -Command" description = "Install test dependencies (mini.nvim)" run = """ mkdir -p deps -test -d deps/mini.nvim || git clone --depth 1 https://github.com/echasnovski/mini.nvim deps/mini.nvim +test -d deps/mini.nvim/.git || (rm -rf deps/mini.nvim && git clone --depth 1 https://github.com/echasnovski/mini.nvim deps/mini.nvim) """ run_windows = """ if (-not (Test-Path deps)) { New-Item -ItemType Directory -Path deps | Out-Null } -if (-not (Test-Path deps/mini.nvim)) { git clone --depth 1 https://github.com/echasnovski/mini.nvim deps/mini.nvim } +if (-not (Test-Path deps/mini.nvim/.git)) { Remove-Item -Recurse -Force deps/mini.nvim -ErrorAction SilentlyContinue; git clone --depth 1 https://github.com/echasnovski/mini.nvim deps/mini.nvim } """ [tasks.test]