Last active
August 29, 2015 14:11
-
-
Save TheMightyLlama/7e300149a901c3ee5642 to your computer and use it in GitHub Desktop.
Get Release Branch Dates
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
function getReleases(){ | |
git fetch &>/dev/null; | |
git checkout develop &>/dev/null; | |
git pull &>/dev/null; | |
for k in $(git branch|sed s/^..//); | |
do | |
#$k is release name | |
if [[ $k == *release* || $k == *hotfix* ]]; then | |
commitHash=`diff -u <(git rev-list --first-parent "$k") <(git rev-list --first-parent develop)|sed -ne 's/^ //p'|head -1`; | |
commitDate=`git show -s --format=%ci $commitHash`; | |
printf "\n"; | |
branchCreation=$commitDate" "$commitHash" "$k; | |
echo $branchCreation; | |
cd /Users/cmacedo/Releases/; | |
if [ ! -e 'ReleasesData.txt' ]; then | |
echo $branchCreation > ReleasesData.txt; | |
else | |
if grep -q $k ReleasesData.txt; | |
then | |
echo "Branch already recorded"; | |
else | |
echo $branchCreation >> ReleasesData.txt; | |
fi | |
fi | |
libon | |
fi | |
done; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment