git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Mike Hommey <mh@glandium.org>
Cc: git@vger.kernel.org
Subject: Re: Rebasing multiple branches at once
Date: Sat, 31 Dec 2016 18:40:33 -0800	[thread overview]
Message-ID: <xmqqmvfb4i5a.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20161231081433.3zo6lrsjsu2qho4u@glandium.org> (Mike Hommey's message of "Sat, 31 Dec 2016 17:14:33 +0900")

Mike Hommey <mh@glandium.org> writes:

> So I now have:
>
> A---G
> \---B---C---D---E
>             \---F
>
> If I do the dumb thing, which is to do `git rebase master E` and `git
> rebase master F`, I end up with:
>
> A---G---B'---C'---D'---E'
>     \---B"---C"---D"---F'
>

What people seem to do is to teach the branch that ends with F that
its upstream is the local branch that ends with E, so that they can
be lazy when rebasing a branch that knows its upstream.  I suspect
that you would end up with

A---G---B'--C'--D'--E'--F'

instead if it is done naively, but if you really care that the
branch that ends with F does not have E, you presumably want to have
the branch that ends at D its own identity, so

 (1) 'master' or whatever that used to end at A and now its tip is
     at G;

 (2) the branch that ends at D whose upstream is 'master';

 (3) the branch that ends at E whose upstream is (2); and

 (4) the branch that ends at F whose upstream is (2).

I personally do not do that, though, because you'd need to remember
the order in which these three branches must be rebased (i.e. (2)
must be done first before rebasing (3) and (4) in any order).


  reply	other threads:[~2017-01-01  2:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-31  8:14 Rebasing multiple branches at once Mike Hommey
2017-01-01  2:40 ` Junio C Hamano [this message]
2017-01-02  6:42   ` Jeff King
2017-01-01  8:42 ` Johannes Sixt
  -- strict thread matches above, loose matches on Subject: below --
2008-10-16 12:17 Rebasing Multiple " Rick Moynihan
2008-10-16 13:59 ` Miklos Vajna
2008-10-16 14:48   ` Rick Moynihan
2008-10-16 21:00     ` Miklos Vajna
2008-10-17  2:00   ` Junio C Hamano
2008-10-16 13:59 ` David Kastrup
2008-10-16 14:57   ` Rick Moynihan
2008-10-16 15:02     ` Robin Burchell
2008-10-16 20:27 ` Toby Allsopp

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqmvfb4i5a.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mh@glandium.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).