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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git commit stopped working #918

Closed
nobe4 opened this Issue May 31, 2017 · 10 comments

Comments

Projects
None yet
3 participants
@nobe4

nobe4 commented May 31, 2017

The problem is quite strange, when I try to commit from the Gstatus window (or from anywhere else with the Gcommit command) Vim flashes and does nothing more... No error, nothing 馃

Here's my config:

$ vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 19 2017 03:58:09)
MacOS X (unix) version
Included patches: 1-567
Compiled by travis@Traviss-Mac-592.local
Huge version with MacVim GUI.  Features included (+) or not (-):
+acl             +find_in_path    -mouse_sysmouse  -tag_any_white
+arabic          +float           +mouse_urxvt     -tcl
+autocmd         +folding         +mouse_xterm     +termguicolors
+balloon_eval    -footer          +multi_byte      +terminfo
+browse          +fork()          +multi_lang      +termresponse
++builtin_terms  +fullscreen      -mzscheme        +textobjects
+byte_offset     -gettext         +netbeans_intg   +timers
+channel         -hangul_input    +num64           +title
+cindent         +iconv           +odbeditor       +toolbar
+clientserver    +insert_expand   +packages        +transparency
+clipboard       +job             +path_extra      +user_commands
+cmdline_compl   +jumplist        +perl/dyn        +vertsplit
+cmdline_hist    +keymap          +persistent_undo +virtualedit
+cmdline_info    +lambda          +postscript      +visual
+comments        +langmap         +printer         +visualextra
+conceal         +libcall         +profile         +viminfo
+cryptv          +linebreak       +python/dyn      +vreplace
+cscope          +lispindent      +python3/dyn     +wildignore
+cursorbind      +listcmds        +quickfix        +wildmenu
+cursorshape     +localmap        +reltime         +windows
+dialog_con_gui  +lua/dyn         +rightleft       +writebackup
+diff            +menu            +ruby/dyn        -X11
+digraphs        +mksession       +scrollbind      -xfontset
+dnd             +modify_fname    +signs           +xim
-ebcdic          +mouse           +smartindent     -xpm
+emacs_tags      +mouseshape      +startuptime     -xsmp
+eval            +mouse_dec       +statusline      -xterm_clipboard
+ex_extra        -mouse_gpm       -sun_workshop    -xterm_save
+extra_search    -mouse_jsbterm   +syntax
+farsi           +mouse_netterm   +tag_binary
+file_in_path    +mouse_sgr       +tag_old_static
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe  -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang   -L. -fstack-protector -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib  -L. -fstack-protector -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib   -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon       -lm  -lncurses -liconv -framework Cocoa   -fstack-protector  -L/System/Library/Perl/5.16/darwin-thread-multi-2level/CORE

The .vimrc I used during the screencast uses vim-plug and only the Fugitive plugin:

$ cat ~/.vimrc
set nocompatible " be iMproved, required
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-fugitive'
call plug#end()
$ git --version
git version 2.5.4 (Apple Git-61)

And a screencast:

I'm doing C, then cc in the Gstatus window.

asciicast

What can I do to debug this a little more? Or is it a reported issue already?


Just tried on a debian with the following config:

$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Feb 10 2013 02:28:47)
Included patches: 1-547
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by jamessan@debian.org
Huge version without GUI.
...
$ git --version
git version 1.7.10.4

And it works just fine 馃

@nobe4 nobe4 changed the title from Git commit stoped working to Git commit stopped working May 31, 2017

@tpope

This comment has been minimized.

Owner

tpope commented May 31, 2017

I'm not sure if you have a web of symlinks or an external worktree or who knows what else but I'm guessing that has something to do with it.

@nobe4

This comment has been minimized.

nobe4 commented May 31, 2017

Fair point, I've setup the same vimrc in a separate folder/git dir under the name _vimrc and launched vim with

$ vim -u _vimrc -N

The same behavior occures...

Also I should have pointed out that this is a quite recent issue. I can't remember at what time it broke but it's quite recent (and the Gbrowse command broke at the same time, but I didn't want to raise everything on just one issue 馃樃).

@tpope

This comment has been minimized.

Owner

tpope commented May 31, 2017

Not sure I follow. Can you try it in a repo that has nothing to do with your dotfiles?

:Gbrowse has had some recent changes so feel free to open a separate issue for that.

@nobe4

This comment has been minimized.

nobe4 commented May 31, 2017

I think I've narrowed down the issue, it seems that the command

$ env GIT_EDITOR=false git commit

is not failing, and from a quick look at the code, it is probably related. While on the second machine I do have:

error: There was a problem with the editor 'false'.
Please supply the message using either -m or -F option.

Which is expected as far as I understood the code. So it has nothing to do with the plugin but more about my shell not showing error message (probably ?)...

@tpope

This comment has been minimized.

Owner

tpope commented May 31, 2017

Sounds like you're on the right track. You might want to check the exit status of the command (echo $?) too.

@nobe4

This comment has been minimized.

nobe4 commented May 31, 2017

Well it's 0, plus the env command isn't showing anything. So something (not fugitive-related) is fishy here... I'll close the issue since it's probably only my config messing around here.

Thanks for the replies and the fantastic plugin 馃槃

@nobe4 nobe4 closed this May 31, 2017

@nobe4

This comment has been minimized.

nobe4 commented May 31, 2017

Solved it, totally unrelated to fugitive 馃憤

@guanyingc

This comment has been minimized.

guanyingc commented Jul 30, 2017

Hi, nobe4 @nobe4 , I came across exactly the same problem recently after reinstalling my Ubuntu14.04. Could you share with me how you solve this problem? Thank you in advance.

@nobe4

This comment has been minimized.

nobe4 commented Jul 31, 2017

@GoYchen, sure: have a look at http://nobe4.fr/vim-as-an-anti-keylogger/
tl;dr: I had been infected with a keylogger using env as its entry point. I hope you're not under the same problem!

@guanyingc

This comment has been minimized.

guanyingc commented Jul 31, 2017

Hi, @nobe4 , thank you very much for your sharing. I had fixed my problem. Great!

My reason is similar with yours. When I typed which env, I found that I was using a script named env of my own. Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment