Is there a bash command to get the date/time a branch was merged into master or develop?
I want to make a program.sh and pass branch name with parameter.
hotfix_1254: master ok | merged on 2016-06-04 17:18
hotfix_1254: develop FAIL | merged on -
You could use a combo of the following, cooked into a script:
From How can I know in git if a branch has been already merged into master? You can use the git merge-base command to find the latest common commit between the two branches. If that commit is the same as your branch head, then the branch has been completely merged.
Take that output (honoring above criteria) and do a
git log -n 1 --pretty=format:%cd branchName to print the commit date
git branch --merged | grep otherBranch
If above is true (ie, otherBranch was merged), then
git merge-base refs/heads/master otherBranch | xargs git log -n 1 --pretty=format:%cd