git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFC] Documentation: Two more git-rebase --onto examples

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 5, 2006, 10:22 UTC
Message-ID
<200611051122.17623.jnareb@gmail.com>
In-Reply-To
<7vbqnmwvib.fsf@assigned-by-dhcp.cox.net>
Thanks for comments.
Junio C Hamano wrote:
Show 9 quoted lines
> Jakub Narebski <jnareb@gmail.com> writes:
> 
>> +More useful example of --onto option usage include transplanting feature
>> +branch from one development branch to other, for example change to branch
>> +based off "next" branch:
> 
> By "more" do you mean the following examples are more useful
> than the one before, or having larger number of examples adds to
> the usefulness of the document overall?

I found original example somewhat artifical, but after thinking on that I guess that the need for rebase onto master~1 might happen when the last commit in master is for example to be amended or rebased.

The "transplanting branch" example feels like more natural to me.
Show 5 quoted lines
> How about:
> 
>         Here is how you would transplant a topic branch based on one
>         branch to another, to pretend that you forked the topic branch
>         from the latter branch, using `rebase --onto`.

Perhaps adding why one might want to transplant topic branch from one development branch to other: for example when feature being developed on topic branch relied on functionality which was at the time topic branch was started available only in 'next' branch, but meanwhile it matured and was merged into 'master' (more stable) branch. One would want to base topic branches on 'master' branch if possible.

[...]
> This looks the same as the original example for --onto; I would
> either drop it or replace it something of different flavor.

This example is from latest post by Andy Parkins, which asked how to do that. But I find your example as being better, because it shows even more power of core git history manipulation.

Show 8 quoted lines
> What I find myself doing more is to reorder without using StGIT.
> When I have this:
> 
> 	1---2---3---4 topic
> 
> and 2 is a bit half-baked, and I would want to have:
> 
> 	1---3'--4'--2' topic
[...]

Here I find lack of --interactive option to at least git-am based rebase; git-rebase could simply pass --interactive option to git-am.

-- 
Jakub Narebski
Previous: Junio C HamanoNext: Jakub Narebski
Message 3 of 8 in “Documentation: Two more git-rebase --onto examples”
  1. Documentation: Two more git-rebase --onto examplesJakub Narebski, Nov 4, 2006
  2. Junio C HamanoNov 5, 2006
  3. Jakub NarebskiNov 5, 2006
  4. Documentation: Transplanting branch with git-rebase --ontoJakub Narebski, Nov 6, 2006
  5. Junio C HamanoNov 6, 2006
  6. Jakub NarebskiNov 6, 2006
  7. Carl WorthNov 6, 2006
  8. Junio C HamanoNov 6, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.