rmarquis / pacaur

[unmaintained] An AUR helper that minimizes user interaction
https://bbs.archlinux.org/viewtopic.php?pid=1755144#p1755144
ISC License
796 stars 113 forks source link

Use --no-ext-diff option when running `git diff`. #770

Closed mrstegeman closed 6 years ago

mrstegeman commented 6 years ago

If the user has an external diff command set up in their git config, such as vimdiff, things go haywire during installation.

rmarquis commented 6 years ago

Thanks. I vaguely remember an issue related to external diff viewer, but can't find the specific issue right now. I'll have a deeper look soon.

mrstegeman commented 6 years ago

If you want to reproduce, you can do the following: git config --global diff.external git_diff_wrapper

The put the following somewhere in your PATH as git_diff_wrapper:

#!/bin/sh

if file "$2" | grep -q text ; then
    vimdiff -c "set wrap" -c "wincmd w" -c "set wrap" -c "wincmd w" "$2" "$5"
elif file "$5" | grep -q text ; then
    vimdiff -c "set wrap" -c "wincmd w" -c "set wrap" -c "wincmd w" "$2" "$5"
else
    vbindiff "$2" "$5"
fi

After doing so, run pacaur -u to upgrade some existing packages (whose package data are already cached on your system). vimdiff will start up in the background, and you'll be forced to kill it in order to continue upgrading.

rmarquis commented 6 years ago

Merged, thx!