Skip to content

Instantly share code, notes, and snippets.

@TheMightyLlama
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheMightyLlama/7e300149a901c3ee5642 to your computer and use it in GitHub Desktop.
Save TheMightyLlama/7e300149a901c3ee5642 to your computer and use it in GitHub Desktop.
Get Release Branch Dates
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