Intro
I am using Git to control hotfixes delivered to production.
When Development team want to deliver some change to production, they create a bundle of files, called a hotfix, and send to Production team. A hotfix is indicated by its ID such as HF1, HF2, ..., HF6
.
Production team is in charge of reviewing each hotfix and confirm them to deploy on production, we are trying to use git to track the status these hotfixes, suppose our git history was like
O-HF1-HF2-HF3 (production)
\-HF4-HF5-HF6-HF7-HF8-HF9 (delivery)
where production
branch has all hotfixes that have been confirmed to production and delivery
branch has the rest of hotfixes delivered by development team but not confirmed to production.
Now suppose that HF8 has a change delivered as SomeJavaClass.class
and we have an urgent need to deploy this hotfix to production while we have not yet finish reviewing HF4 - HF7. We would do as follows
using
git rebase -i HF3
and reorder the delivery branch so that HF8 become the first item next to HF3usually this will end up with a conflict because there will be some files in HF4 - HF7 that have changes to which HF8 depens. We have to find all such hotfixes and rebase them together. For exameple, suppose HF5 and HF7 also have change in
SomeJavaClass.class
and therefore are dependencies of HF8, we would rebase the history toO-HF1-HF2-HF3 (production) \-HF5-HF7-HF8-HF4-HF6-HF9 (delivery)
merge
production
branch to HF8O-HF1-HF2-HF3-HF5-HF7-HF8 (production) \-HF4-HF6-HF9 (delivery)
The question
Is there a git command that help me find all hotfixes between HF4 - HF7 that is a dependency of HF8 before doing the rebase?
Note: My purpose is to develop a shell script that, given HFX as the input, do the rebase and merge HFX and all of its dependency hotfixes in delivery
branch to production
branch.