Created
November 28, 2012 10:15
-
-
Save motemen/4160297 to your computer and use it in GitHub Desktop.
Git: List recently changed branches
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
OPTS_SPEC="\ | |
git recent-branches [options] | |
-- | |
days= Days to back (defaults 7) | |
date= Date format {relative,local,iso,rfc,short,raw,default} | |
no-merged Show only branches not merged into HEAD | |
" | |
eval "$(echo "$OPTS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)" | |
OPTIONS='' | |
while [ -n "$1" ]; do | |
case $1 in | |
"--days") | |
shift | |
DAYS="$1" | |
;; | |
"--date") | |
shift | |
DATE="$1" | |
;; | |
"--no-merged") | |
OPTIONS="$OPTIONS --not HEAD" | |
esac | |
shift | |
done | |
git log --date=${DATE-default} --remotes --simplify-by-decoration --no-merges \ | |
--pretty='format:%C(blue)%ad%Creset %C(yellow)%H%Creset - %s %C(bold)[%an]%Creset' \ | |
--since="{${DAYS-7} days ago}" \ | |
$OPTIONS \ | |
| git name-rev --stdin --name-only | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment