Problem statement:
The problem is this I have this commit with hash a5214bbb9f , I want to find which prod release included this change. The git commit time is not 100% reliable because we are doing merges, so technically, I can commit a change in 2021, and only merge that today. more generally, to translate the problem in git, given a commit, I want to know the first merge commit (a release is always a merge commit) that introduced that commit.
Turns out it’s not so easy. There is this solution from stackoverflow. https://stackoverflow.com/questions/8475448/find-merge-commit-which-includes-a-specific-commit
I don’t know how it works, but I tested that it works… This is quite cool, because now, we can see this specific hash was first merged into env/uat in 1.26.0-rc.4 !
git show-merge a5214bbb9f origin/env/uat … Merge pull request #4971 from prep/uat Deploy 1.26.0-rc.4 to UAT
git show-merge a5214bbb9f origin/env/prod … Merge pull request #5290 from Saltus-Partners/prep/prod ON-0000 - Deploy 1.26.0