From 392a6ca904bbcfab32ed80fe05ba301848942dd6 Mon Sep 17 00:00:00 2001 From: Basetta Date: Sat, 3 Mar 2012 08:32:29 +0100 Subject: [PATCH] Function that return local branches list order by date --- plugins/git/git.plugin.zsh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index e1d682508..ace8d9349 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -54,6 +54,16 @@ function current_branch() { echo ${ref#refs/heads/} } +# +# Will return the local branches order by date +# +function gbabydate() { + for b in `git branch --no-color 2> /dev/null | sed -e 's/*//'`; + do + echo -e `git log -1 --format=%Cgreen%ci%Creset "$b" --`\\t"$b"; + done | sort +} + # these aliases take advantage of the previous function alias ggpull='git pull origin $(current_branch)' compdef ggpull=git