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

Re: rebase -i: quick/inline reword

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 16, 2020, 16:55 UTC
Message-ID
<xmqqy2me4jj6.fsf@gitster.c.googlers.com>
In-Reply-To
<87imdipymt.fsf@osv.gnss.ru>
Sergey Organov <sorganov@gmail.com> writes:
Show 9 quoted lines
>> I only looked at its description but the UI the tool does it with
>> looks quite obvious and intuitive.  From its source, the "merge"
>> operation does not seem to handle merging a side branch that renamed
>> files, but that should be OK most of the time, I presume.
>
> From the docs:
>
> No merge commits may occur between the target commit and HEAD, as
> rewriting them is not supported. 

I didn't read the documentation that deeply, but it's irrelevant that the tool can handle only a single strand of pearls.

You need a merge machinery to implement even a cherry-pick of a single parent commit; an obvious way to implement cherry-pick of commit C on HEAD is to perform three-way merges between C and HEAD, pretending as if C^1 is their sole common ancestor.

Our cherry-pick uses the merge-recursive machinery to do so, and because the sequencer inherited the idea and implementation, "git rebase -i" does the same. They instead use their own written in Python to merge at the tree-level and farms the content-level merge out to "git merge-file".

The "recursive" part of the "merge-recursive" machinery we use does not help cherry-pick at all (as we use only one "common"), but it handles renames. They can do the same in their merge_trees(), but they currently don't.

But as I said, that should be OK most of the time, I would think.
>> Nice.
>
> Yeah, it is!
That part is still true ;-)
Previous: Sergey OrganovNext: Sergey Organov
Message 12 of 13 in “rebase -i: quick/inline reword”
  1. Solomon UckoMay 7, 2020
  2. Junio C HamanoMay 7, 2020
  3. Jeff KingMay 7, 2020
  4. Sergey OrganovMay 7, 2020
  5. Solomon UckoMay 7, 2020
  6. Sergey OrganovMay 7, 2020
  7. brian m. carlsonMay 8, 2020
  8. Sergey OrganovMay 8, 2020
  9. Johannes AltmanningerAug 16, 2020
  10. Junio C HamanoAug 16, 2020
  11. Sergey OrganovAug 16, 2020
  12. Junio C HamanoAug 16, 2020
  13. Sergey OrganovAug 16, 2020

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.