mirror of
https://github.com/TimUntersberger/neogit
synced 2024-09-08 02:25:52 +02:00
Merge branch 'master' into cherry-pick-options
This commit is contained in:
commit
0ff7933895
7 changed files with 9 additions and 26 deletions
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ end
|
|||
---@field cmd string[]
|
||||
---@field cwd string|nil
|
||||
---@field env table<string, string>|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
|
||||
|
|
Loading…
Reference in a new issue