]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - vcs/setup.sh
vcs/gitconfig: support older gits without `stash push`
[config/dotfiles.git] / vcs / setup.sh
index 8ea39ac39c5b1f81a1f266203a70dbf1e0038d51..3c04f595a54012dc696e50268aa19a2106384e31 100755 (executable)
@@ -42,6 +42,12 @@ if installed git; then
         sed_i 's/log --patch/log -p/' gitconfig
     fi
 
+    if git stash push -- doesnt-exist 2>&1 \
+            | grep 'usage: git stash list' > /dev/null; then
+        echo 'gitconfig: replacing "stash push" with "stash save"'
+        sed_i 's/stash push/stash save/g' gitconfig
+    fi
+
     # If coloredstderr is used to color stderr then remove the workaround for
     # missing output to stderr.
     if test -n "${LD_PRELOAD:+set}" \