summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-02-14 15:43:19 +0100
committerJan Pokorný <jpokorny@redhat.com>2014-02-14 15:43:19 +0100
commit7afda1f08683cc2bc8400d91cdce3a6ea8ba2ff3 (patch)
tree088d42a1fbf1f2d4df620fce5e742a53817c876f
parenta94b94789042c9ac0e0dd4c0e1afe41b445cb0e0 (diff)
downloaddotfiles-7afda1f08683cc2bc8400d91cdce3a6ea8ba2ff3.tar.gz
dotfiles-7afda1f08683cc2bc8400d91cdce3a6ea8ba2ff3.tar.xz
dotfiles-7afda1f08683cc2bc8400d91cdce3a6ea8ba2ff3.zip
Git config: add "su" show unpushed (updated)
Partly based on http://stackoverflow.com/questions/2969214 Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r--.gitconfig4
1 files changed, 4 insertions, 0 deletions
diff --git a/.gitconfig b/.gitconfig
index dcff481..a9d5252 100644
--- a/.gitconfig
+++ b/.gitconfig
@@ -16,6 +16,10 @@
dh = diff HEAD
wd = diff --word-diff
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!\";\
+ }; git_su"
pd = "!git_pd() {\
git diff --color \"$@\" | subdiff | ${PAGER};\
}; git_pd"