From: Craig Ringer <ringerc@ringerc.id.au>
To: Maciek Sakrejda <m.sakrejda@gmail.com>
Cc: Dave Cramer <pg@fastcrypt.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: git gururs
Date: Sat, 03 Nov 2012 15:34:29 +0800
Message-ID: <5094C905.5060505@ringerc.id.au> (raw)
In-Reply-To: <CAOtHd0AqkT4iUPej1PhNoZrRmA-K0Eyu+FAR+gV6h6TJBMgDmg@mail.gmail.com>
References: <CADK3HHL2R8T7WX5McDftw8k1sawm4+tWZ=_HiyMFYD9jTRSjrA@mail.gmail.com>
<CAOtHd0AqkT4iUPej1PhNoZrRmA-K0Eyu+FAR+gV6h6TJBMgDmg@mail.gmail.com>
On 11/02/2012 03:13 AM, Maciek Sakrejda wrote:
> Git cherry-pick is probably the right tool for this. Commit on master,
> and cherry-pick that commit from all branches you want to back-patch
> to (note that due to the way git names commits, you can just say "git
> cherry-pick master" to grab the latest commit from master). If the
> most recent release branch has not diverged from master (that is, all
> commits on master are also on this branch), you can just merge master
> into the branch (a fast-forward merge) to make it current. It will do
> the same thing as a cherry-pick, but more simply.
>
> This is fairly simple, but just as importantly, it keeps the semantics
> you want: you are making changes to master (trunk), but back-porting
> them to select branches. It also keeps the commit history fairly
> clean.
I'd second that. git cherry-pick is very useful. The other tool I use a
fair bit is `git merge --squash` when I want to compact the contents of
a messy working branch down to a single commit. I usually prefer to `git
rebase --interactive` the working branch to clean it up then `git merge`
it into the target branch, but that isn't always practical.
The main thing I find to be important is to maintain clear, discrete
units of work, not change sets that fix X and Y and add Z. That way you
can easily keep track of the fact that change <x> is in branches A, B and C.
--
Craig Ringer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: ringerc@ringerc.id.au, m.sakrejda@gmail.com, pg@fastcrypt.com
Subject: Re: git gururs
In-Reply-To: <5094C905.5060505@ringerc.id.au>
References: <CADK3HHL2R8T7WX5McDftw8k1sawm4+tWZ=_HiyMFYD9jTRSjrA@mail.gmail.com> <CAOtHd0AqkT4iUPej1PhNoZrRmA-K0Eyu+FAR+gV6h6TJBMgDmg@mail.gmail.com> <5094C905.5060505@ringerc.id.au>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox