From: Simon Ruderich Date: Sat, 7 Jul 2018 06:19:44 +0000 (+0200) Subject: vcs/gitconfig: support older gits without `stash push` X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=d105227b4987b9e743a72b82086b61693e00fb96;p=config%2Fdotfiles.git vcs/gitconfig: support older gits without `stash push` Broken in 4fc2ad6 ("vcs/gitconfig: replace "stash save" with "stash push" in aliases", 2018-06-13). --- diff --git a/vcs/setup.sh b/vcs/setup.sh index 8ea39ac..3c04f59 100755 --- a/vcs/setup.sh +++ b/vcs/setup.sh @@ -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}" \