Git development
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Björn Steinbrink" <B.Steinbrink@gmx.de>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH RFC] rebase: add --revisions flag
Date: Wed, 9 Dec 2009 16:02:36 +0200	[thread overview]
Message-ID: <20091209140236.GL2977@redhat.com> (raw)
In-Reply-To: <20091209131945.GB30218@atjola.homenet>

On Wed, Dec 09, 2009 at 02:19:45PM +0100, Björn Steinbrink wrote:
> On 2009.12.08 22:00:17 +0200, Michael S. Tsirkin wrote:
> > On Tue, Dec 08, 2009 at 08:11:07PM +0100, Björn Steinbrink wrote:
> > > So you can already do what you want to do, but wrapping it in a single
> > > porcelain might still be useful because it's obviously a  lot easier and
> > > safer that way. That said, I wonder what kind of workflow you're using
> > > though, and why you require that feature. I've never needed something
> > > like that.
> > 
> > I need this often for many reasons:
> > -	Imagine developing a patchset with a complex bugfix on master branch.
> > 	Then I decide to also apply (backport) this patchset to stable branch.
> 
> Hm, I'd also imagine that you want a separate branch then, and not
> directly mess up the stable branch,

Well, directly working with a stable branch is easier, so yes,
I want to mess it up: this is just my local tree, if anything
goes wrong  I just don't push or "reset --hard origin/stable".

> so I'd do:
> git branch foo-stable foo # Create a branch for the backport
> git rebase --onto stable master foo-stable # Backport
> 
> Now you got your backported version and can merge it to "stable".

The annoying thing is that merge step. I can create a merge
commit if I mistype things, and I do not want any
merge commits, I want to create linear history.

> Common wisdom is do things the other way around though. Create the
> bugfix for the oldest branch that it applies to, then merge it forward,
> either doing:
> 
> "bugfix -> stable" and "stable -> master" merges, or
> "bugfix -> stable" and "bugfix -> master" merges.
> 
> That approach has the advantage that you don't get multiple commits
> doing the same thing, which you get with rebasing/cherry-picking.
> 
> IIRC the gitworkflows manpage describe that in some more detail.


I know. The advantage of making all changes to master first
is that this way a change gets more review and testing before
being applied to stable. Further, often different people
maintain master and stable branches.

> > -	Imagine developing a bugfix/feature patchset on master branch.
> > 	Then I decide the patchset is too large/unsafe and want to
> > 	switch it to staging branch.
> 
> Hm, so you have a topic branch "foo" based upon master, but it's too
> experimental so you don't want to merge it to master, but "staging". I
> don't see why you even have to rebase it then. "staging" is likely ahead
> of master, so the merge base of "foo" and "master" is also reachable
> through "staging", and simply merging "foo" to "staging" should work
> without any ill-effects.

Yes but I want my development history to be linear,
so that format patch rebase -i etc work well.

> > -	I have a large queue of patches on staging branch, I decide that
> > 	a range of patches is mature enough for master.
> 
> Basically, same deal as with the first two cases. If the series is
> directly on "staging" (i.e. you didn't create a topic branch), you can
> create one now:
> git branch foo $last_commit_for_foo
> git rebase --onto master $first_commit_for_foo^ foo
> 
> And you got your backported topic branch for "foo".
> 
> Or you already have a topic branch "foo-staging", but it's based upon
> some commit only in "staging" but not in "master", so a plain merge
> would mess things up. Same deal as with backporting from "master" to
> "stable"

Yes, I understand that creating a temporary branch and checking it out
then merging it will make rebase do what I want.
The only disadvantage is that I need to remember where I am in the
process, while an "atomic" command does this for me.

> And in this case it's also true that basing the topic branches on
> "master" instead of "staging" makes things easier. That way, you can
> merge to either "staging" or "master" without any ill-effects.
> 
> Björn

As above, I do not want merges.

  reply	other threads:[~2009-12-09 14:05 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-08 14:47 [PATCH RFC] rebase: add --revisions flag Michael S. Tsirkin
2009-12-08 16:08 ` Björn Steinbrink
2009-12-08 16:11   ` Michael S. Tsirkin
2009-12-08 16:41     ` Björn Steinbrink
2009-12-08 16:49       ` Michael S. Tsirkin
2009-12-08 19:13         ` Björn Steinbrink
2009-12-08 16:14   ` Michael S. Tsirkin
2009-12-08 16:37     ` Björn Steinbrink
2009-12-08 16:44       ` Michael S. Tsirkin
2009-12-08 19:11         ` Björn Steinbrink
2009-12-08 20:00           ` Michael S. Tsirkin
2009-12-09 13:19             ` Björn Steinbrink
2009-12-09 14:02               ` Michael S. Tsirkin [this message]
2009-12-09  4:51         ` Miles Bader
2009-12-08 20:22 ` Junio C Hamano
2009-12-08 20:29   ` Sverre Rabbelier
2009-12-09  5:30     ` Christian Couder
2009-12-09  6:52       ` Christian Couder
2009-12-09  9:08         ` Sverre Rabbelier
2009-12-09  8:47   ` Peter Krefting
2009-12-09  9:37     ` Michael S. Tsirkin
2009-12-09 10:52       ` Peter Krefting
2009-12-09 11:22         ` Björn Steinbrink
2009-12-09 11:48           ` Andreas Schwab
2009-12-09 12:06             ` Björn Steinbrink
2009-12-09 12:07               ` Michael S. Tsirkin
2009-12-09 13:06                 ` Björn Steinbrink
2009-12-09 19:46                   ` Junio C Hamano
2009-12-10  7:43                     ` Björn Steinbrink
2009-12-10 17:20                       ` Junio C Hamano
2009-12-11 11:07                         ` Björn Steinbrink
2009-12-09 13:20           ` Peter Krefting
2009-12-09 13:41             ` Björn Steinbrink
2009-12-10  8:43               ` Peter Krefting
2009-12-10 11:08                 ` Björn Steinbrink
2009-12-09 10:38   ` Michael S. Tsirkin
2009-12-09 10:55     ` Matthieu Moy
2009-12-09 13:30   ` Matthieu Moy
2009-12-09 13:45     ` Michael S. Tsirkin
2009-12-09 14:01       ` Björn Steinbrink
2009-12-09 14:12         ` Michael S. Tsirkin
2009-12-09 20:10     ` Junio C Hamano
2009-12-13 22:47   ` David Kågedal

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=20091209140236.GL2977@redhat.com \
    --to=mst@redhat.com \
    --cc=B.Steinbrink@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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