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

Re: rebasing merges

From
Stephen Haberman <stephen@exigencecorp.com>
Date
Sep 23, 2008, 07:46 UTC
Message-ID
<20080923024653.a3bb8666.stephen@exigencecorp.com>
In-Reply-To
<48D88813.9060400@viscovery.net>
> This is the expected behavior and not up for debate.
Cool, thanks for the reply. However, I debate... :-)
>   ---o--o--o--o--o--o         <-- origin
>                      \
>                       A'--B'  <-- master
Nice. That makes sense in your scenario.
Here is mine:
 ---A--B--C--D           <-- origin/stable
     \       |
      E--F   |           <-- origin/topica
          \  |
             g--h        <-- topica

All the upper case commits have been published to origin. Other devs, etc., know about them, their hashes are in the bug tracking system.

I'm bringing topica up to date, but with a merge because I have published history already on topica, so I merge stable and get a new merge commit: g. And maybe make another change: h.

Everything's cool...now, with surprising frequency, someone beats me to moving origin/topica:

 ---A--B--C--D           <-- origin/stable
     \       |
      E--F---|--I        <-- origin/topica
          \  |
             g--h        <-- topica

Pushing h gets rejected as a rewind. Good. I want to pull, which we had previously always used "--rebase" for, and the desired output of a pull --rebase, to me, would be:

 ---A--B--C--D           <-- origin/stable
     \        \
      E--F--I |          <-- origin/topica
             \|
              g'--h'     <-- topica
Instead, I get:
 ---A--B--C--D           <-- origin/stable
     \
      E--F--I            <-- origin/topica
             \
              B'-C'-D'-h'<-- topica

So, yes, linearized history with no merges. However, this leads to quizzical looks when B'/C'/D' hit the email list, bug tracker, etc. as new commits.

Currently I just try to pull/merge/push in quick succession, but it's a manual collaboration hack ("okay, I'm merging now, no committing...") that would be nice to not have to worry about.

I need to investigate the interactive rebase more, but my hesitant assertion is that it's parent rewriting seems smart enough to handle this. Perhaps not, and I admit our desired DAG output may not be attainable without manual intervention.

I apologize--I should have included the example DAGs in my first post, but since I didn't I felt the need to clarify. So, humoring me, is the B'/C'/D' from this example really the expected behavior?

I can work on a new test in t3400/etc. if that is of interest.

Thanks for your time, Stephen

Previous: Andreas EricssonNext: Johannes Sixt
Message 7 of 14 in “rebasing merges”
  1. Stephen HabermanSep 22, 2008
  2. Stephen HabermanSep 23, 2008
  3. Johannes SixtSep 23, 2008
  4. Samuel TardieuSep 23, 2008
  5. Johannes SixtSep 23, 2008
  6. Andreas EricssonSep 23, 2008
  7. Stephen HabermanSep 23, 2008
  8. Johannes SixtSep 23, 2008
  9. Andreas EricssonSep 23, 2008
  10. Stephen HabermanSep 23, 2008
  11. Andreas EricssonSep 23, 2008
  12. Stephen HabermanSep 23, 2008
  13. Stephen HabermanSep 23, 2008
  14. SZEDER GáborSep 23, 2008

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.