Subject: bug#11153: change automake branching policy: dispensing with the 'branch-X.Y' branches in the future

From: Peter Rosin <[email-masked]>
Date: Tue, 03 Apr 2012 00:01:26 +0200

On 2012-04-02 21:42, Stefano Lattarini wrote:
> Hi Peter, thanks for the feedback.  But I fear we have a misunderstanding
> here.  See below.
> 
> On 04/02/2012 08:14 PM, Peter Rosin wrote:
>> On 2012-04-02 18:13, Stefano Lattarini wrote:
>>> Severity: wishlist
>>> thanks
>>>
>>> Hello Automakers.
>>>
>>> After some real hand-on experience with the current branching policy
>>> of Automake, I'm convinced the presence of the 'branch-X.Y' branches
>>> is just an annoyance and a source of confusion, and that a better policy
>>> would be to simply have a 'maint' branch (where to cut maintenance
>>>  releases directly from), a master branch (where maint is to be kept
>>> regularly merged into, and from which the next major release is to be
>>> derived at last), and possibly topic branches (only when needed, and
>>> better if they are short-lived).  Maybe we could also re-add the 'next'
>>> branch to serve as common ground for feature merging and testing, but
>>> than can be done in a second time (and only if the need arise).
>>>
>>> When a major release is done, the master branch is to be merged into
>>> the maint branch, and then a "new" master branch created stemming
>>> from the resulting commit.
>>
>> I think what you are proposing is better described as dropping the
>> maint branch and doing development of features for both the stable
>> series as well as the pending major release directly on the stable
>> branch.
>>
> Absolutely not.  In 'maint' will go bugfixes, minor new features
> (with low protability of regressions), and possibly new warnings for
> obsoleted features (that might be removed when we pass to a future
> "major" version).  In master will go "bigger" new feature, non-trivial
> refactorings, and backward-incompatible changes (after their coming
> has been duly announced and prepared in 'maint' and/or in earlier
> releases).

Ok, you didn't understand what I meant with dropping maint instead of
release.  My bad.  I think the rest is just follow-up-confusion
resulting from that misunderstanding.  I'll try to explain what I
mean again...

I think we should do exactly as you describe above.  However, for the
class of changes that are related to the actual release from maint we
should not use the maint branch, and therefore we need three branches.
I.e. we should not commit, to maint, exactly those changes that we do
not want on master but still want in the maintenance releases.
E.g. we will *never* want the change bumping the version from 1.12.3 to
1.12.4 on master.  Now, if we do not have both maint and branch-1.12,
we will have to jump through hoops to not get those changes into master
when we next merge maint into master.

I see two alternatives if there is no branch-1.12 (but see below,
near the end, when I think of a third option with short-lived branches)

1. resolve the merge conflicts, and hope that all changes that
   we don't want on master really do result in conflicts so that
   we don't neglect to fix them up in the merge.
2. merge from maint into master before the release-related commits
   and then do a dummy merge (--strategy=ours) afterwards so that
   the changes are ignored when we do a real merge later.  And
   hope that no real changes have weaseled their way into the "release
   window" between the pre-release merge and the dummy post-release
   merge.

I just happen to think those hoops are a worse cure than the disease
(an extra branch) they are targeting.  I.e., I think that maintenance
releases should happen from a separate branch from maint, so that
maint always merges as cleanly as possible into master.  That separate
branch is branch-x.y.  I fail to see what is wrong with the current
setup.

So, how do you intend to jump through the hoops described above
without the extra branch?

I only see one argument for killing the third branch, and that is the
msvc confusion.  And yes, we did make a mess of it with the msvc branch,
but we have learned and will not be so easily duped into pulling in
changes in branch-x.y without going via the maint branch the next time
we have the urge to merge a topic-branch with code suitable for master
into a maintenance release.

> This is basically the situation we have today, but without the extra
> indirections and possibility of confusion (i.e., another 'msvc'-style
> mess will be made less likely).

I think we have learned that lesson, I don't think we will mess up like
that again.  I therefore do not think it's a valid argument for killing
the third branch.

>> When you wish to make a new release you simply make sure
>> you have merged the latest branch-x.y into master, then create a new
>> branch-x.<y+1> or branch-<x+1>.0 from where the current master is
>> and you're done.
>>
> You mean that if we have just released automake 1.13, the release
> 1.13.1 should be cut from master?  That is absolutely *not* what I
> want to do.  Sorry if I didn't explain myself clearly enough.

That's of course not what I meant.  Make that "When you wish to
make a new release-series".  I.e. when you have released 1.14.5 and
want to release 1.15 (or 2.0 or whatever else non-maintenance).

>>> WDYT?  If you agree, I can apply the change below to HACKING, and
>>> implement the new branching policy starting from the Automke 1.12
>>> release.
>>
>> Consider what will happen if you don't have maint branches,
>>
>> [SNIP]
>>
> I snip mostly of the rest of your arguments, now that it is clear
> I still *want* to have a maint branch.

I don't agree that it's a maint branch if you include the commits
related to the release on it.  By doing that, you have a release
branch that is not suitable for merging into master in the way that
a maintenance branch would be.

>> I think it's immensely more clean to have the current dual maint and
>> branch-1.11 approach for each expected bug-fix series.
>>
> Here I don't follow you.  Why are not 'maint' a 'master' enough exactly?

See above.

>> When 1.12 is released, maint should probably move along with it
>>
> Yes, and a "new" master created, from which 1.13 will be finally derived.

No, you need never create a new master, that's not a sane view of
what happens.  It's saner to view it as if you branch off
whatever you need from master to make the major releases.

>> and a maint-1.11 can be created when needed, if a security fix is ever
>> needed for the 1.11 series.
>>
> Agreed.  But we don't need this branch right away, since the last commit
> in the 'maint' of the 1.11.x series will be properly tagged, so we can
> easily access need and create a bug-fix branch out of it if and when the
> need arises.

Yes, but that's no argument for killing the current three branch system.

>> Hopefully, we will not need a maint-1.11, but such things
>> are as they are...
>>
> OK, so it sounds like we are in violent agreement in this matter.

We agree on most things, but not on the thing you want to do, namely
kill one of the three branches.

>> Either that, or you'd need to do dummy merges from branch-x.y into
>> master after the release-related commits just to avoid future merge
>> conflicts, but dummy merges are ugly in my opinion.  And branches are
>> cheap.
>>
> Tags even more -- you don't pay them with the risk of confusion.
> 
>> I think we have learned not to merge new features past the maintenance
>> branch (i.e. directly into the release branch)
>>
> Huh?  That *exactly* what should happen most of the time!  It's the
> AM_PROG_AR situation that was an unusual case, in that we didn't want
> the delay in the 1.12 release to keep this useful and low-risk feature
> as "vaporware" for even more time -- so we merged it into the
> maintenance branch.

No, we merged it into the release branch.  We only merged it into
the maintenance branch later.

*time passes*

Hmmm, do you perhaps mean to create short-lived branches based on
maint for each release?

I.e. approximately this, I'm sure I'm missing some detail...

# time for major release
git checkout master
git merge maint
git checkout maint
git branch maint-1.11    # in case we happen to need it later
git merge master         # fast-forward, no commit needed
git branch release-1.12
git checkout release-1.12
# do version number bumps etc on release-1.12
git tag v1.12
git checkout master
git branch -D release-1.12
# time passes
# time for minor release
git checkout maint
git branch release-1.12.1
git checkout release-1.12.1
# do version number bumps etc on release-1.12.1
git tag v1.12.1
git checkout maint
git branch -D release-1.12.1

In that case, that works for me and all objections dropped, and
sorry for not getting it right away...

Cheers,
Peter