]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
setup.sh,gitconfig: Support old Git without diff --patience.
authorSimon Ruderich <simon@ruderich.org>
Sat, 15 Sep 2012 13:40:04 +0000 (15:40 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sat, 15 Sep 2012 13:40:04 +0000 (15:40 +0200)
gitconfig.m4
setup.sh

index 0aaf9c0a2f84aa8cabf1df25bfea8d1787b51b21..7d8d6c4466b683e812feb87a77dbc4a91df5151c 100644 (file)
@@ -56,16 +56,16 @@ include(../lib.m4)
        # Local.
        c   = commit --verbose
        ci  = commit --verbose
-       d   = diff --patience
-       di  = diff --patience
-       dw  = diff --patience --color-words
-       dc  = diff --patience --cached
-       dcw = diff --patience --cached --color-words
+       d   = diff PATIENCE
+       di  = diff PATIENCE
+       dw  = diff PATIENCE --color-words
+       dc  = diff PATIENCE --cached
+       dcw = diff PATIENCE --cached --color-words
        s   = status
        st  = status
        l   = log
        ls  = log --stat
-       lp  = log --patch --patience
+       lp  = log --patch PATIENCE
        a   = add
        ap  = add --patch
        au  = add --update
index d59568ff712b6b7db01e0a1df3c4eb037cc5349b..0ef9e6af12dcdc7067a3195ef52abd6296a6ba98 100755 (executable)
--- a/setup.sh
+++ b/setup.sh
 . ../lib.sh
 
 if installed git; then
+    # Older Git versions don't support --patience.
+    PATIENCE=
+    if git diff --patience >/dev/null 2>&1; then
+        PATIENCE=--patience
+    fi
+
     generate m4 gitconfig \
         -DGITIGNORE=`pwd`/gitignore \
+        -DPATIENCE="$PATIENCE" \
         -DOS=`os`
     link gitconfig ~/.gitconfig
 fi