Skip to content

Instantly share code, notes, and snippets.

@mx-moth
Last active August 29, 2015 14:21
Show Gist options
  • Save mx-moth/5b37161512dd190f3514 to your computer and use it in GitHub Desktop.
Save mx-moth/5b37161512dd190f3514 to your computer and use it in GitHub Desktop.
nvim and git add --patch do not play nice
Script started on Wed 27 May 2015 12:44:03 AEST
test@nightjar:~$ export EDITOR=nvim
test@nightjar:~$ export VISUAL=nvim
test@nightjar:~$ env
XDG_VTNR=1
XDG_SESSION_ID=3
COMP_WORDBREAKS=
"'><;|&(:
SHELL=/bin/bash
TERM=screen-256~color
XDG_SESSION_COOKIE=9610489eca6e490e97450bb83943f278-1432694325.161693-1010021324
USER=test
LS_COLORS=
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
MAIL=/var/mail/test
PWD=/home/test
EDITOR=nvim
LANG=en_AU.UTF-8
XDG_SEAT=seat0
HOME=/home/test
SHLVL=2
LANGUAGE=en_AU:en
LOGNAME=test
VISUAL=nvim
_=/usr/bin/env
test@nightjar:~$ nvim --version
NVIM 0.0.0-alpha+201505251630 (compiled May 26 2015 12:34:15)
Commit: a7b5ae37a71dae93f86da3003bf267fc4f4490f0
Build type: Debug
Compilation: /usr/bin/cc -Wconversion -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -I/home/tim/fucking-around/neovim/build/config -I/home/tim/fucking-around/neovim/src -I/home/tim/fucking-around/neovim/.deps/usr/include -I/home/tim/fucking-around/neovim/.deps/usr/include -I/home/tim/fucking-around/neovim/.deps/usr/include/luajit-2.0 -I/home/tim/fucking-around/neovim/.deps/usr/include -I/home/tim/fucking-around/neovim/.deps/usr/include -I/home/tim/fucking-around/neovim/.deps/usr/include -I/home/tim/fucking-around/neovim/.deps/usr/include -I/usr/include -I/home/tim/fucking-around/neovim/build/src/nvim/auto -I/home/tim/fucking-around/neovim/build/include
Compiled by tim@nightjar
Optional features included (+) or not (-): +acl +iconv +jemalloc
For differences from Vim, see :help vim-differences
system vimrc file: "$VIM/nvimrc"
user vimrc file: "~/.nvimrc"
2nd user vimrc file: "~/.nvim/nvimrc"
user exrc file: "~/.exrc"
fall-back for $VIM: "/usr/local/share/nvim"
test@nightjar:~$ git init repo
Initialized empty Git repository in /home/test/repo/.git/
test@nightjar:~$ cd repo
test@nightjar:~/repo$ touch file1 file2
test@nightjar:~/repo$ git add file1 file2
test@nightjar:~/repo$ git commit -m 'Initial commit'
[master (root-commit) 05d3a4a] Initial commit
Committer: Test Account <[email protected]>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email [email protected]
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
2 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 file1
create mode 100644 file2
test@nightjar:~/repo$ cat > file1
Some changes
test@nightjar:~/repo$ cat > file2
Some changes
test@nightjar:~/repo$ git add . -p
diff --git a/file1 b/file1
index e69de29..c02392e 100644
--- a/file1
+++ b/file1
@@ -0,0 +1 @@
+Some changes
Stage this hunk [y,n,q,a,d,/,e,?]? e
... nvim is opened up. Quit it to continue ...
diff --git a/file2 b/file2
index e69de29..c02392e 100644
--- a/file2
+++ b/file2
@@ -0,0 +1 @@
+Some changes
Stage this hunk [y,n,q,a,d,/,e,?]? @@ -0,0 +1 @@
+Some changes
Stage this hunk [y,n,q,a,d,/,e,?]? @@ -0,0 +1 @@
+Some changes
Stage this hunk [y,n,q,a,d,/,e,?]? @@ -0,0 +1 @@
+Some changes
Stage this hunk [y,n,q,a,d,/,e,?]? @@ -0,0 +1 @@
+Some changes
Stage this hunk [y,n,q,a,d,/,e,?]? @@ -0,0 +1 @@
+Some changes
Stage this hunk [y,n,q,a,d,/,e,?]? @@ -0,0 +1 @@
+Some changes
Stage this hunk [y,n,q,a,d,/,e,?]? @@ -0,0 +1 @@
+Some changes
Stage this hunk [y,n,q,a,d,/,e,?]? @@ -0,0 +1 @@
+Some changes
Stage this hunk [y,n,q,a,d,/,e,?]? @@ -0,0 +1 @@
+Some changes
Stage this hunk [y,n,q,a,d,/,e,?]? @@ -0,0 +1 @@
... Snip ~59000 lines of the same ...
+Some changes
Stage this hunk [y,n,q,a,d,/,e,?]? @@ -0,0 +1 @@
+Some changes
Stage this hunk [y,n,q,a,d,/,e,?]? @@ -0,0 +1 @@
+Some changes
Stage this hunk [y,n,q,a,d,/,e,?]? @@ -0,0 +1 @@
+Some changes
^C
test@nightjar:~/repo$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: file1
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: file2
test@nightjar:~/repo$ exit
Script done on Wed 27 May 2015 12:45:16 AEST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment