diff --git a/lua/neogit/client.lua b/lua/neogit/client.lua index 85fa3f91..23581d87 100644 --- a/lua/neogit/client.lua +++ b/lua/neogit/client.lua @@ -147,8 +147,7 @@ function M.wrap(cmd, opts) end logger.debug("[CLIENT] Calling editor command") - local result = - cmd.env(M.get_envs_git_editor(opts.show_diff)).call { verbose = true, pty = opts.interactive } + local result = cmd.env(M.get_envs_git_editor(opts.show_diff)).call { pty = opts.interactive } a.util.scheduler() logger.debug("[CLIENT] DONE editor command") diff --git a/lua/neogit/lib/git/cli.lua b/lua/neogit/lib/git/cli.lua index b1d9458e..0d986be2 100644 --- a/lua/neogit/lib/git/cli.lua +++ b/lua/neogit/lib/git/cli.lua @@ -967,14 +967,12 @@ local function new_builder(subcommand) cwd = git.repo.git_root, env = state.env, pty = state.in_pty, - verbose = opts.verbose, on_error = opts.on_error, } end local function make_options(options) local opts = vim.tbl_extend("keep", (options or {}), { - verbose = false, hidden = false, trim = true, remove_ansi = true, @@ -998,7 +996,6 @@ local function new_builder(subcommand) call = function(options) local opts = make_options(options) local p = to_process { - verbose = opts.verbose, on_error = function(res) -- When aborting, don't alert the user. exit(1) is expected. for _, line in ipairs(res.stdout) do diff --git a/lua/neogit/lib/git/index.lua b/lua/neogit/lib/git/index.lua index fdc7fc9a..d929d08b 100644 --- a/lua/neogit/lib/git/index.lua +++ b/lua/neogit/lib/git/index.lua @@ -150,7 +150,6 @@ function M.update() require("neogit.process") .new({ cmd = { "git", "update-index", "-q", "--refresh" }, - verbose = false, on_error = function(_) return false end, diff --git a/lua/neogit/lib/git/merge.lua b/lua/neogit/lib/git/merge.lua index 6e1cc05c..77d43148 100644 --- a/lua/neogit/lib/git/merge.lua +++ b/lua/neogit/lib/git/merge.lua @@ -2,13 +2,11 @@ local client = require("neogit.client") local git = require("neogit.lib.git") local notification = require("neogit.lib.notification") -local a = require("plenary.async") - ---@class NeogitGitMerge local M = {} local function merge_command(cmd) - return cmd.env(client.get_envs_git_editor()).call { verbose = true, pty = true } + return cmd.env(client.get_envs_git_editor()).call { pty = true } end local function fire_merge_event(data) @@ -16,7 +14,6 @@ local function fire_merge_event(data) end function M.merge(branch, args) - a.util.scheduler() local result = merge_command(git.cli.merge.args(branch).arg_list(args)) if result.code ~= 0 then notification.error("Merging failed. Resolve conflicts before continuing") diff --git a/lua/neogit/lib/git/rebase.lua b/lua/neogit/lib/git/rebase.lua index 3715e83f..a5257a47 100644 --- a/lua/neogit/lib/git/rebase.lua +++ b/lua/neogit/lib/git/rebase.lua @@ -11,7 +11,7 @@ local function fire_rebase_event(data) end local function rebase_command(cmd) - return cmd.env(client.get_envs_git_editor()).call { verbose = true, long = true, pty = true } + return cmd.env(client.get_envs_git_editor()).call { long = true, pty = true } end ---Instant rebase. This is a way to rebase without using the interactive editor diff --git a/lua/neogit/lib/notification.lua b/lua/neogit/lib/notification.lua index 824b579a..67ae4559 100644 --- a/lua/neogit/lib/notification.lua +++ b/lua/neogit/lib/notification.lua @@ -1,6 +1,5 @@ local M = {} local config = require("neogit.config") -local util = require("neogit.lib.util") ---@param message string message to send ---@param level integer vim.log.levels.X @@ -11,11 +10,7 @@ local function create(message, level, opts) end vim.schedule(function() - vim.notify( - util.remove_ansi_escape_codes(message), - level, - { title = "Neogit", icon = config.values.notification_icon } - ) + vim.notify(message, level, { title = "Neogit", icon = config.values.notification_icon }) end) end diff --git a/lua/neogit/process.lua b/lua/neogit/process.lua index b8c40a98..3c853d1f 100644 --- a/lua/neogit/process.lua +++ b/lua/neogit/process.lua @@ -20,7 +20,6 @@ end ---@field cmd string[] ---@field cwd string|nil ---@field env table|nil ----@field verbose boolean If true, stdout will be written to the console buffer ---@field result ProcessResult|nil ---@field job number|nil ---@field stdin number|nil @@ -278,16 +277,13 @@ function Process:spawn(cb) if not self.buffer:is_visible() and code > 0 and self.on_error(res) then local output = {} - local start = math.max(#res.output - 16, 1) - for i = start, math.min(#res.output, start + 16) do - insert(output, " " .. res.output[i]) + local start = math.max(#res.stderr - 16, 1) + for i = start, math.min(#res.stderr, start + 16) do + insert(output, "> " .. util.remove_ansi_escape_codes(res.stderr[i])) end - local message = string.format( - "%s:\n\n%s\n\nAn error occurred.", - mask_command(table.concat(self.cmd, " ")), - table.concat(output, "\n") - ) + local message = + string.format("%s:\n\n%s", mask_command(table.concat(self.cmd, " ")), table.concat(output, "\n")) notification.warn(message) end