git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Keeping <john@keeping.me.uk>
To: "Quilkey, Tony" <trq@thorpesystems.com>
Cc: git@vger.kernel.org
Subject: Re: Workflow Help
Date: Tue, 21 May 2013 10:23:14 +0100	[thread overview]
Message-ID: <20130521092314.GO27005@serenity.lan> (raw)
In-Reply-To: <CAMATmi3bU7hrD-YLY1iVXbekxOx_XZfZ5yYNBfzV_VFSc_W5jw@mail.gmail.com>

On Tue, May 21, 2013 at 10:59:17AM +1000, Quilkey, Tony wrote:
> I am looking at formulating and then documenting our vcs workflow
> using Git at work. I have an idea of how I want things to work, but am
> a little hazy on some of the details.
> 
> Our basic workflow will be based around:
> http://nvie.com/posts/a-successful-git-branching-model, with a few
> exceptions.
> 
> We would like to create our release-* branches from the last release
> tag. From there, we would like the ability to cherry pick (or take the
> complete diff) commits from the develop branch.
>
> So, we are after is:
> 
> 1) Create topic (feature) branches from develop, and merge back into
> develop when complete.
> 
> 2) Once it is decided we are packaging a release, make a release-*
> branch from the previous release tag.
> 
> 3) Cherry pick/merge/whatever any commits we want from develop into
> the new release-* until it is complete.
> 
> 4) Merge the new release-* branch into master and tag it.
> 
> Repeat as necessary.
> 
> At the moment I am a little stuck on how exactly we can cherry pick
> stuff from develop into a release-* branch. I'm not even sure this
> approach is exactly what we should be doing.

Having been involved in a couple of projects that use cherry-pick like
this, I strongly advise against doing this.  It makes it much harder
than it needs to be to find out which branches contain a particular
commit.

The workflow described in the URL above does the more sensible thing of
periodically merging the release branch(es) back into master (or
develop).  This is similar to the workflow Junio uses to develop Git
itself, which is described in gitworkflows(7).

The idea is to start your topic branch from the oldest release to which
a bugfix must be applied, then merge it into the appropriate release
branches.  Then you merge this branch upwards into the later release
branches and your development branch.  So your development branch always
contains all release branches (not just similar commits, but the *same*
commits so that each release branch tip is an ancestor of the
development branch's tip).

This means that you can use "git branch --contains" or "git describe
--contains" to answer the question "which release(s) contain this
commit?", whereas with cherry picking there is no easy and reliable way
to do so.

> Our main concern is that at this stage, there is no guarantee that all
> commits within develop can be pulled into a release.

One advantage of starting a bugfix topic branch from the oldest release
it applies to is that you are developing and testing that fix on the
release code.  If it doesn't apply cleanly to the development branch
then you fix the conflict when merging.

Of course you may start a bugfix branch from the wrong place, in which
case you would have to cherry pick the commits back to an older branch,
but this should be a rare occurrence and will sort itself out as you
merge the fix upwards.

> In regards to how we can achieve the above results any input would be
> much appreciated. Or if there are any other better options available,
> I'm all ears.

  reply	other threads:[~2013-05-21  9:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-21  0:59 Workflow Help Quilkey, Tony
2013-05-21  9:23 ` John Keeping [this message]
2013-05-21 13:07 ` Magnus Bäck
2013-05-21 13:49 ` Andreas Ericsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130521092314.GO27005@serenity.lan \
    --to=john@keeping.me.uk \
    --cc=git@vger.kernel.org \
    --cc=trq@thorpesystems.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).