summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-04-25 14:50:12 +0200
committerJan Pokorný <jpokorny@redhat.com>2014-04-25 14:50:12 +0200
commit9b626a966d30c45262b554129f90e14788f3f5d3 (patch)
tree34bfe5c51ead4d85857651d0e3d1e14cfb7c7547
parent362deef625b1b5c5bd9cc8353e4c27d750aedeeb (diff)
downloaddotfiles-9b626a966d30c45262b554129f90e14788f3f5d3.zip
dotfiles-9b626a966d30c45262b554129f90e14788f3f5d3.tar.gz
dotfiles-9b626a966d30c45262b554129f90e14788f3f5d3.tar.xz
Git config: su: do not "show" when nothing eligible
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r--.gitconfig3
1 files changed, 2 insertions, 1 deletions
diff --git a/.gitconfig b/.gitconfig
index 71aaaab..b4aa693 100644
--- a/.gitconfig
+++ b/.gitconfig
@@ -20,7 +20,8 @@
swd = show --word-diff
su = "!git_su() {\
set -- $(git rev-list --left-right --count @{u}...HEAD);\
- git show -$2; test $1 -eq 0 || echo \"also $1 behind!\";\
+ test $2 -eq 0 || git show -$2;\
+ test $1 -eq 0 || echo \"also $1 behind!\";\
}; git_su"
pd = "!git_pd() {\
git diff --color \"$@\" | subdiff | ${PAGER};\