Should I merge my git feature branches from master or staging ?

32 views
Skip to first unread message

Nikolai Plath

unread,
Mar 23, 2012, 11:17:37 PM3/23/12
to Joomla! Platform Development
This is a general question about how to proceed with my branches
before making a pull request..

So, before making a pull request you should merge (or rebase) your
branch with the current code from the Joomla! repository.

The question is if your should merge the master or the staging branch.
Every time I read about this topic so far it was advised to merge
against the staging branch. It also seems to be a common practice
followed by everyone. But why ??

In my opinion the staging branch is a temporary thingy, used to test
changes. So it has to be considered "dirty" at a given time - as long
as joomla-jenkins is running tests against it. If those tests fail,
due to unit tests or checkstyle errors, the content of the staging
branch would not be pushed to the master branch.

So if you merge this (dirty) staging branch into your feature branch
you will actually also merge those errors.

Of course there is Jools aka Ian's PullTester who kind of "pre checks"
the pull request, so errors should not even hit the staging branch
but... you know ;)

So the question is why not always merge your feature branches with the
joomla-platform/master branch ?

Hope that makes any sense at all ;)
Nikolai

Rob Schley

unread,
Mar 24, 2012, 2:18:50 AM3/24/12
to joomla-de...@googlegroups.com
I always work from master. The only time I look at staging is if something got merged that broke staging and I'm trying to fix it. 

Best,
Rob

Michael Babker

unread,
Mar 24, 2012, 5:00:20 AM3/24/12
to joomla-de...@googlegroups.com
Same here.  More often than not, the two branches are the same anyways, so you really wouldn't see much difference except for those instances where someone broke something by accident.

Ian

unread,
Mar 24, 2012, 8:02:37 AM3/24/12
to joomla-de...@googlegroups.com
I'm not necessarily saying you should work against staging, but one argument for doing so is that you will be less likely to have merge conflicts if something has been merged into staging but hasn't been merged into master.

What I mean is, when your code gets merged, it gets merged into staging and not into master.  So it is more important in some respects to make sure your code can merge into staging rather than master.

I hope that makes sense.

Ian
Reply all
Reply to author
Forward
0 new messages