Permalink
Cannot retrieve contributors at this time
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?
dot-files/.githelpers
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
50 lines (42 sloc)
1.1 KB
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/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" | |
} |