gregsexton / gitv

gitk for Vim.
938 stars 59 forks source link

Error on `grs` #124

Closed Aludirk closed 6 years ago

Aludirk commented 7 years ago

When use grs, the following error is shown:

Error detected while processing function <SNR>54_RebaseToggle:
line   43:
fatal: Needed a single revision

vim version:

:version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Dec  1 2016 06:20:27)
MacOS X (unix) version
Included patches: 1-106
Compiled by travis@Traviss-Mac-592.local
Huge version with MacVim GUI.  Features included (+) or not (-):
+acl             +clientserver    +cursorbind      +ex_extra        +fullscreen      +langmap         +modify_fname    +mouse_urxvt     +path_extra      +reltime         +syntax          +timers          +viminfo         -xpm
+arabic          +clipboard       +cursorshape     +extra_search    -gettext         +libcall         +mouse           +mouse_xterm     +perl/dyn        +rightleft       +tag_binary      +title           +vreplace        -xsmp
+autocmd         +cmdline_compl   +dialog_con_gui  +farsi           -hangul_input    +linebreak       +mouseshape      +multi_byte      +persistent_undo +ruby/dyn        +tag_old_static  +toolbar         +wildignore      -xterm_clipboard
+balloon_eval    +cmdline_hist    +diff            +file_in_path    +iconv           +lispindent      +mouse_dec       +multi_lang      +postscript      +scrollbind      -tag_any_white   +transparency    +wildmenu        -xterm_save
+browse          +cmdline_info    +digraphs        +find_in_path    +insert_expand   +listcmds        -mouse_gpm       -mzscheme        +printer         +signs           -tcl             +user_commands   +windows
++builtin_terms  +comments        +dnd             +float           +job             +localmap        -mouse_jsbterm   +netbeans_intg   +profile         +smartindent     +termguicolors   +vertsplit       +writebackup
+byte_offset     +conceal         -ebcdic          +folding         +jumplist        +lua/dyn         +mouse_netterm   +num64           +python/dyn      +startuptime     +terminfo        +virtualedit     -X11
+channel         +cryptv          +emacs_tags      -footer          +keymap          +menu            +mouse_sgr       +odbeditor       +python3/dyn     +statusline      +termresponse    +visual          -xfontset
+cindent         +cscope          +eval            +fork()          +lambda          +mksession       -mouse_sysmouse  +packages        +quickfix        -sun_workshop    +textobjects     +visualextra     +xim
   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
rbong commented 6 years ago

I am having difficulty recreating this. Could you provide a minimal test case? I will keep trying to find out what could cause this.

Aludirk commented 6 years ago

bash:

git init
echo "abc" > a.txt
git add a.txt
git commit -m "Initial commit."
git branch test
git checkout test
echo "def" > b.txt
git add b.txt
git commit -m "test"
git checkout master
vim a.txt

vim:

:Gitv

Gitv:

press `a` to show the commit in branch `test`
cursor point to commit in `test`
press `grs`
choose the commit to rebase

show above error


if press grr, then show the following error:

Error detected while processing function <SNR>56_Rebase[12]..<SNR>56_RebaseGetRange[65]..<SNR>56_RebaseGetChoice[2]..<SNR>56_GetConfirmString:
line    5:
E745: Using a List as a Number
E15: Invalid expression: a:list + a:000
line    6:
E121: Undefined variable: totalList
E116: Invalid arguments for function s:ConfirmStringBipartiteGraph(totalList)
E15: Invalid expression: s:ConfirmStringBipartiteGraph(totalList)
line    7:
E121: Undefined variable: G
E116: Invalid arguments for function s:MaxBipartiteMatching(G)
E15: Invalid expression: s:MaxBipartiteMatching(G)
line    9:
E121: Undefined variable: totalList
E15: Invalid expression: totalList
Choose destination to rebase onto:
[O]k: 

after press o:

Error detected while processing function <SNR>56_Rebase:
line   23:
fatal: no such branch: 2
rbong commented 6 years ago

Thanks for the minimal test case, worked perfectly. This was fixed by the previous fix I made. There were some issues rebasing onto HEAD which have been fixed as well. Feel free to reopen if your issue persists.