git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Sergey Organov <sorganov@gmail.com>
Cc: Johannes Altmanninger <aclopte@gmail.com>,
	git@vger.kernel.org, sandals@crustytoothpaste.net,
	solly.ucko@gmail.com
Subject: Re: rebase -i: quick/inline reword
Date: Sun, 16 Aug 2020 09:55:57 -0700	[thread overview]
Message-ID: <xmqqy2me4jj6.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <87imdipymt.fsf@osv.gnss.ru> (Sergey Organov's message of "Sun, 16 Aug 2020 15:24:10 +0300")

Sergey Organov <sorganov@gmail.com> writes:

>> 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 ;-)

  reply	other threads:[~2020-08-16 16:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07  4:27 rebase -i: quick/inline reword Solomon Ucko
2020-05-07  4:52 ` Junio C Hamano
2020-05-07 11:46   ` Jeff King
2020-05-07 12:17     ` Sergey Organov
2020-05-07 14:01   ` Solomon Ucko
2020-05-07 10:49 ` Sergey Organov
2020-05-08  0:05   ` brian m. carlson
2020-05-08 21:14     ` Sergey Organov
2020-08-16  0:14       ` Johannes Altmanninger
2020-08-16  5:36         ` Junio C Hamano
2020-08-16 12:24           ` Sergey Organov
2020-08-16 16:55             ` Junio C Hamano [this message]
2020-08-16 12:21         ` Sergey Organov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqy2me4jj6.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=aclopte@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sandals@crustytoothpaste.net \
    --cc=solly.ucko@gmail.com \
    --cc=sorganov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).