From c33d7fcb9f0f85046ea2931ad135f58587abcaab Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Thu, 11 Jul 2019 11:58:00 -0400 Subject: [PATCH] Show stderr on :Gcommit References https://github.com/tpope/vim-fugitive/pull/1115 --- autoload/fugitive.vim | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index dacf9c2..9561eb7 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2996,10 +2996,9 @@ function! s:CommitCommand(line1, line2, range, count, bang, mods, reg, arg, args redraw! endif if !exec_error + echo join(errors, "\n") if filereadable(outfile) - for line in readfile(outfile) - echo line - endfor + echo join(readfile(outfile), "\n") endif call fugitive#ReloadStatus(dir, 1) return after[1:-1] @@ -3036,11 +3035,13 @@ function! s:CommitCommand(line1, line2, range, count, bang, mods, reg, arg, args let b:fugitive_commit_arguments = argv setlocal bufhidden=wipe filetype=gitcommit return '1' . after - elseif error ==# '!' - echo get(readfile(outfile), -1, '') + elseif empty(errors) + let out = readfile(outfile) + echo get(out, -1, '') =~# 'stash\|\d' ? get(out, -2, '') : out[-1] return after[1:-1] else - call s:throw(empty(error)?join(errors, ' '):error) + echo join(errors, "\n") + return after[1:-1] endif endif catch /^fugitive:/