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

Re: [SCRIPT/RFC 0/3] git-commit --onto-parent (three-way merge, no working tree file changes)

From
IDIgor Djordjevic <igor.d.djordjevic@gmail.com>
Date
Dec 9, 2017, 03:03 UTC
Message-ID
<92643df4-f54e-cd31-da4a-138ec314655a@gmail.com>
In-Reply-To
<D842B04A-9331-4F26-8F19-B61F6F13FC79@gmail.com>
Hi Alexei,
On 09/12/2017 03:18, Alexei Lozovsky wrote:
Show 10 quoted lines
> 
> > Chris reported in this very topic[1] that sometimes, due to
> > conflicts with later commits, "checkout > commit > [checkout >]
> > rebase --onto" is "much easier to do", where "commit --fixup >
> > rebase -i" "breaks" (does not apply cleanly).
> 
> It was more of a rant about conflict resolution by rebase rather than
> a concern about modification time of files. While I'd prefer git to
> not touch the source tree unnecessarily, it's not really a big deal
> for me if it does and some parts of the project need to be rebuilt.

Nevertheless, I found it valuable in supporting the case where "commit --fixup > rebase -i" seems to require even more work than otherwise necessary :)

But thanks for clarifying, anyway, it does feel like `git rebase -i --autosquash` could be smarter in this regards, if `git rebase --onto` does it better...?

Even though your explanation seems clear, having a real, easily reproducible case would help as well, I guess.

Show 7 quoted lines
> I kinda hoped that you may know this magic and incorporate it into 
> "commit --onto" which will allow to immediately get to the result of 
> the rebase:
> 
>   ---A---f!A---B'
> 
> without spelling it all manually.

If you mind enough to be bothered testing it out, might be even existing/initial state of originally proposed `git commit --onto-parent` script would work for you, as it does incorporate some trivial three-way merge resolution.

In your starting situation:
    ---A---B
... you would just do something like:
    git commit --onto-parent A

... hopefully ending up in the desired state (hopefully = conflicts automatically resolved):

    ---A---C---B'
You could even do this instead:
    git commit --onto-parent A --amend
... ending up with:
    ---A'---B'
... as that is basically what you wanted in the first place ;)
> (And yeah, I'm actually Alexei, not Chris. That was my MUA being
> dumb and using an old pseudonym than Google insists I'm called by.)
Ah, sorry for the confusion :)
Regards, Buga
Previous: Alexei LozovskyNext: Phillip Wood
Message 17 of 26 in “[SCRIPT/RFC 0/3] git-commit --onto-parent (three-way merge, no working tree file changes)”
  1. Igor DjordjevicNov 26, 2017
  2. 1/3 setup.shIgor Djordjevic, Nov 26, 2017
  3. 3/3 git-commit--onto-parent.shIgor Djordjevic, Nov 26, 2017
  4. 2/3 git-merge-one-file--cachedIgor Djordjevic, Nov 26, 2017
  5. Johannes SixtNov 27, 2017
  6. Igor DjordjevicNov 28, 2017
  7. Johannes SixtNov 29, 2017
  8. Igor DjordjevicNov 29, 2017
  9. Johannes SixtDec 1, 2017
  10. Igor DjordjevicDec 4, 2017
  11. Johannes SixtDec 6, 2017
  12. Junio C HamanoDec 6, 2017
  13. Igor DjordjevicDec 8, 2017
  14. Junio C HamanoDec 8, 2017
  15. Igor DjordjevicDec 8, 2017
  16. Alexei LozovskyDec 9, 2017
  17. Igor DjordjevicDec 9, 2017
  18. Phillip WoodDec 9, 2017
  19. Igor DjordjevicDec 10, 2017
  20. Phillip WoodDec 10, 2017
  21. Igor DjordjevicDec 10, 2017
  22. Alexei LozovskyDec 11, 2017
  23. Alexei LozovskyDec 11, 2017
  24. Phillip WoodDec 9, 2017
  25. Chris NerwertNov 30, 2017
  26. Igor DjordjevicDec 3, 2017

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.