views:

98

answers:

2

We have two branches: 1. HEAD - the latest version (AKA Trunc) 2. PROD - the released version

When you fix bugs in the released version, which of these do you do:

  1. Fix it in PROD, then merge to HEAD
  2. Fix it in HEAD, then merge to PROD

The advantage of (1) is that this way you absolutely cannot harm the released version by accidentally bringing over untested code from HEAD (The assumption is that PROD is always more stable/tested than HEAD).

The advantage of (2) is that there might be more usages for a piece of code in HEAD than in PROD, so if you fix only in PROD you might not find all such usages and so slip bugs into HEAD.

I'm personally for (1). What do you think?

+4  A: 

Bug fixes should be applied to the branch and merged to the the main line of development. You need to do this to avoid bringing new features into a production release that are not intended to be there. Note that easiest way to do this if you need the change in the HEAD may be to apply identical changes in both branches.

tvanfosson
A: 

(1) as well.

Do not forget that not every bugs fixed into PROD have to be merged back into HEAD.

Sometimes, your current code has already evolved in such a way the bugs fixed into PROD are no longer relevant.

VonC