Skip to content
Permalink
e2ca20cc2f
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
50 lines (42 sloc) 1.1 KB
#!/bin/bash
function delete_local_merged_branches() {
git branch --merged master | grep -v master | xargs git branch -d
}
function delete_remote_merged_branches() {
git fetch origin
git remote prune origin
for BRANCH in `git branch -r --merged origin/master |\
egrep "^\s*origin/" |\
grep -v master |\
grep chrishunt |\
cut -d/ -f2-`
do
git push origin :$BRANCH
done
}
function weekly_summary() {
LAST_WEEK=$(date -v-7d +%m/%d)
STATS=$(
git log --since=1.week --oneline |
tail -n 1 |
awk '{ print $1 }' |
xargs git diff --shortstat
)
FEATURES=$(
git log --since=1.week --oneline |
egrep "Merge (pull|branch) "
)
FEATURES_COUNT=$(
echo "$FEATURES" |
sed '/^\s*$/d' |
wc -l |
awk '{ print $1 }'
)
echo "Stats ($LAST_WEEK - Today)"
echo "---------------------"
echo "$STATS"
echo
echo "Features ($FEATURES_COUNT)"
echo "-------------"
echo "$FEATURES"
}