git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: linux@horizon.com
To: junkio@cox.net, linux@horizon.com
Cc: git@vger.kernel.org
Subject: Re: Why can't git-rebase back up?
Date: 18 Feb 2006 03:56:08 -0500	[thread overview]
Message-ID: <20060218085608.30325.qmail@science.horizon.com> (raw)
In-Reply-To: <7vmzgpru8m.fsf@assigned-by-dhcp.cox.net>

> The one in "next" has a topic branch change which lets you say:
> 
>	$ git rebase --onto v2.6.16-rc2 v2.6.16-rc3 build
>
> which is a shorthand for
>
>	$ git checkout build
>	$ git rebase --onto v2.6.16-rc2 v2.6.16-rc3
>
> That is, tear out my changes that forked from the development
> trail that led to v2.6.16-rc3, and graft them on top of
> v2.6.16-rc2.

Ah, exactly what I was looking for!
However, why did you decide to make the *destination* the option?

Just giving a naive user's perspective, the argument to git-rebase
is the *destination*, and it "magically" figures out the source.

It would seem more natural to me to have an option to explicltly
specify the "from" and leave the positional argument as the "to".

That also lets you do something about the rebasing-a-merged-branch
problem.  If you have:
      g-->h-->i-->j topic
     /       /
a-->b-->c-->d-->e-->f master

Then I'd expect "git-rebase master topic" to fail with
an error message like:

	Error: "topic" and "master" do not have a unique common
		ancestor.  Possible common ancestors:
		b (master~4)
		d (master~2)
	Rebasing a branch with merges is generally not recommended,
	but if you want to do it, you need to specify where to cut
	off the branch to move.  You probably want one of the above.

And you have to use "git-rebase --from b master" or --from d.
H'm... is that unique?  What if you have a bizarre merge pattern
line


     k--->l---->m
    /            \
    | g-->h-->i-->j topic
    |/        
a-->b-->c-->d-->e-->f master

or 

      g-->h-->i-->j topic
     /       /
a-->b---------->c-->d master

is "--from b" well-defined?  I'll have to play with the existing
code to see what it does.

  reply	other threads:[~2006-02-18  8:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-17 13:59 Why can't git-rebase back up? linux
2006-02-17 14:36 ` Andreas Ericsson
2006-02-17 15:34   ` linux
2006-02-17 16:30     ` Andreas Ericsson
2006-02-18  7:39       ` Junio C Hamano
2006-02-18  7:39 ` Junio C Hamano
2006-02-18  8:56   ` linux [this message]
2006-02-18  9:15     ` Junio C Hamano
2006-02-18 13:00       ` linux
2006-02-18 14:53         ` Johannes Schindelin

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=20060218085608.30325.qmail@science.horizon.com \
    --to=linux@horizon.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /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).