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

Re: rebase -p loses amended changes

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 4, 2012, 23:20 UTC
Message-ID
<7vhawz6q3v.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAH3AnrphGmrZSxALP3j3ADt6Cg4Tr2O83mcDBU2LfUdpdtUCUw@mail.gmail.com>
Jon Seymour <jon.seymour@gmail.com> writes:
Show 9 quoted lines
> On Thu, Apr 5, 2012 at 8:59 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> Jon Seymour <jon.seymour@gmail.com> writes:
>>
>>> Are there any flaws, I wonder?
>>
>> It all depends on how close the base is to M^1. ...
>
> True. I guess it is still true there are no perfect solutions in this
> area. This does seem like a step in a better direction, though.

The nice thing about Hannes's "replay the change between M^1 and M" is that it sidesteps the fundamentally impossible part of your original idea, which is to mechanically sift the "evil" part out of "pure merge" part out. Instead, it replays the change as a single ball of wax.

That difference between these two approaches may make the replaying of M easier or harder, depending on how M^1 and your new base relate to each other, so it is hard to say if it is really a step in a better direction. Perhaps M is a merge made to the maint branch, and you may be replaying it on top of a newer codebase based on the master track. M^1 may lack many changes the new base has, so replaying M by applying the patch between M^1 and M may give you a lot of conflict that you should not have to resolve if you simply merged M^2 to the new base. And the worst part of this conflict resolution is that you cannot easily tell what the right solution should be unless you look at M, M^1 and M^2---that forces you to sift the "evil" part out of "pure merge" part in the original merge. The good news is that this is *not* mechanical, as you have your own intelligence to help that process ;-)

Previous: Jon SeymourNext: Martin von Zweigbergk
Message 14 of 18 in “Re: rebase -p loses amended changes”
  1. Jon SeymourMar 31, 2012
  2. Thomas RastMar 31, 2012
  3. Jon SeymourMar 31, 2012
  4. J Robert RayApr 3, 2012
  5. Jon SeymourApr 3, 2012
  6. Junio C HamanoApr 3, 2012
  7. Phil HordApr 3, 2012
  8. Johannes SixtApr 4, 2012
  9. Junio C HamanoApr 4, 2012
  10. Junio C HamanoApr 4, 2012
  11. Jon SeymourApr 4, 2012
  12. Junio C HamanoApr 4, 2012
  13. Jon SeymourApr 4, 2012
  14. Junio C HamanoApr 4, 2012
  15. Martin von ZweigbergkApr 5, 2012
  16. Jon SeymourApr 5, 2012
  17. Martin von ZweigbergkApr 5, 2012
  18. Johannes SixtApr 10, 2012

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.