From 3d022a9fbccbcea4bee5a30c5e502469a66f1fb2 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sun, 13 Apr 2014 23:35:59 -0700 Subject: [PATCH] change git which-branch definition to be compatible with old git. --- dotfiles/gitconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/gitconfig b/dotfiles/gitconfig index 0019c48c..2bb09dda 100644 --- a/dotfiles/gitconfig +++ b/dotfiles/gitconfig @@ -23,7 +23,7 @@ # Diff a file or show it in git's pager if it is untracked du = "!d() { git ls-files $1 --error-unmatch 2>/dev/null 1>/dev/null && git diff $1 || `git config --get core.pager` $1; }; d" - which-branch = symbolic-ref HEAD --short + which-branch = "!wb() { b="$(git symbolic-ref HEAD)" && echo ${b#refs/heads/}; }; wb" # symbolic-ref HEAD --short sha = rev-parse HEAD branch-or-sha = "!bs() { git which-branch 2> /dev/null || git sha 2> /dev/null ; }; bs" amend = commit -a --amend -C HEAD