Skip to main content
added 1027 characters in body
Source Link
Ewan
  • 84.4k
  • 5
  • 91
  • 189

You are correct. Hotfix branches screw GitFlow because the merge to master may not be the same as the merge to develop. Thus when you come to merge in your release branch, the post merge code may be different.

Here is an example.

master v1 has a bug in the email sender. I create a hotfix branch to fix it

Emailer.Send(Message m)
{
   smtpclient.Send(m); //fixed! this was commented out!!
}

This merges into master fine the only change was removing the commented out line. But in develop we have already refactored the email sender so when I come to merge I have to resolve the conflict manually

Emailer.Send(Message m)
{
   _client.Send(m, timeout); //this was commented out and renamed
}

I carry on with develop, branch to release v2 and finally come to merge release v2.2 into master.

I get a merge conflict, because the emailer class has been changed separately in both branches and I have to manually resolve it. When doing so I make a mistake

Emailer.Send(Message m)
{
   _client.send(m, timeout);
}

Now the build from release v2.2 which was tested and works fine and the build from master tag v2.2 which will fail are from different codebases.

You are correct. Hotfix branches screw GitFlow because the merge to master may not be the same as the merge to develop. Thus when you come to merge in your release branch, the post merge code may be different.

You are correct. Hotfix branches screw GitFlow because the merge to master may not be the same as the merge to develop. Thus when you come to merge in your release branch, the post merge code may be different.

Here is an example.

master v1 has a bug in the email sender. I create a hotfix branch to fix it

Emailer.Send(Message m)
{
   smtpclient.Send(m); //fixed! this was commented out!!
}

This merges into master fine the only change was removing the commented out line. But in develop we have already refactored the email sender so when I come to merge I have to resolve the conflict manually

Emailer.Send(Message m)
{
   _client.Send(m, timeout); //this was commented out and renamed
}

I carry on with develop, branch to release v2 and finally come to merge release v2.2 into master.

I get a merge conflict, because the emailer class has been changed separately in both branches and I have to manually resolve it. When doing so I make a mistake

Emailer.Send(Message m)
{
   _client.send(m, timeout);
}

Now the build from release v2.2 which was tested and works fine and the build from master tag v2.2 which will fail are from different codebases.

Source Link
Ewan
  • 84.4k
  • 5
  • 91
  • 189

You are correct. Hotfix branches screw GitFlow because the merge to master may not be the same as the merge to develop. Thus when you come to merge in your release branch, the post merge code may be different.