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

Re: rebase -p confusion in 1.6.1

From
Stephan Beyer <s-beyer@gmx.net>
Date
Jan 15, 2009, 13:38 UTC
Message-ID
<20090115133808.GA10045@leksak.fem-net>
In-Reply-To
<slrngmu4j5.e1u.sitaramc@sitaramc.homelinux.net>
Hi Sitaram,
Sitaram Chamarty wrote:
Show 24 quoted lines
> The outputs I got really confused me.  Before the "rebase
> -p", the tree looked like
>     
>     * 78ffda9... (refs/heads/work) b4
>     * be1e3a4... b3
>     *   cd8d893... Merge branch 'master' into work
>     |\
>     | * 0153c27... (refs/heads/master) a4
>     | * 74f4387... a3
>     * | f1b0c1c... b2
>     * | 2e202d0... b1
>     |/
>     * b37ae36... a2
>     * ed1e1bc... a1
> 
> But afterward, this is what it looks like -- all the "b"
> commits are gone!
> 
>     * 0153c27... (refs/heads/work, refs/heads/master) a4
>     * 74f4387... a3
>     * b37ae36... a2
>     * ed1e1bc... a1
> 
> What did I do wrong/misunderstand?

Hmm, you are rebasing onto master which is merged into the branch you want to rebase. So, I think the correct output should be the same like git rebase without -p, ie

* 1337bee... (refs/heads/work) b4
* deadbee... b3
* badbeef... b2
* fa1afe1... b1
* 0153c27... (refs/heads/master) a4
* 74f4387... a3
* b37ae36... a2
* ed1e1bc... a1

This is because master is already merged into work and a preserved merge will see that everything is already merged in.

Well, so I think you've discovered a bug.
> (2) git config alias.lg log --graph --pretty=oneline --abbrev-commit --decorate
Funny, I have exactly the same alias, but named "logk".
Show 12 quoted lines
>     git init
>     testci a1 a2
>     git checkout -b work
>     testci b1 b2
>     git checkout master
>     testci a3 a4
>     git checkout work
>     git merge master
>     testci b3 b4
>     git --no-pager lg   # graph before rebase -p
>     git rebase -p master
>     git --no-pager lg   # graph after rebase -p
Thanks and regards,
  Stephan
-- 
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
Previous: Sitaram ChamartyNext: Johannes Schindelin
Message 6 of 28 in “rebase -p confusion in 1.6.1”
  1. Sitaram ChamartyJan 15, 2009
  2. Johannes SchindelinJan 15, 2009
  3. Sitaram ChamartyJan 15, 2009
  4. Stephan BeyerJan 15, 2009
  5. Sitaram ChamartyJan 15, 2009
  6. Stephan BeyerJan 15, 2009
  7. Johannes SchindelinJan 15, 2009
  8. Sitaram ChamartyJan 15, 2009
  9. Michael J GruberJan 15, 2009
  10. Stephan BeyerJan 15, 2009
  11. Michael J GruberJan 15, 2009
  12. Johannes SchindelinJan 15, 2009
  13. Michael J GruberJan 15, 2009
  14. Johannes SchindelinJan 15, 2009
  15. Sitaram ChamartyJan 15, 2009
  16. Johannes SchindelinJan 15, 2009
  17. Sitaram ChamartyJan 15, 2009
  18. Michael J GruberJan 15, 2009
  19. Johannes SchindelinJan 15, 2009
  20. Stephan BeyerJan 15, 2009
  21. Johannes SchindelinJan 15, 2009
  22. Sitaram ChamartyJan 15, 2009
  23. Johannes SchindelinJan 17, 2009
  24. Johannes SchindelinJan 17, 2009
  25. Stephen HabermanJan 18, 2009
  26. Johannes SchindelinJan 18, 2009
  27. Stephen HabermanJan 18, 2009
  28. Stephen HabermanJan 18, 2009

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.