Git development
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Nikita Orlov <fatemail@mail.ru>, Kevin Daudt <me@ikke.info>,
	git@vger.kernel.org
Subject: Re: git loses a commit after reordering.
Date: Tue, 2 May 2017 16:29:37 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1705021608580.3480@virtualbox> (raw)
In-Reply-To: <xmqqwpa0f8zm.fsf@gitster.mtv.corp.google.com>

Hi Junio, Kevin & Nikita,

On Mon, 1 May 2017, Junio C Hamano wrote:

> Nikita Orlov <fatemail@mail.ru> writes:
> 
> >>On Sun, 30 Apr 2017, 1:56 +03:00 from Kevin Daudt <me@ikke.info>:
> >>Not sure if this is the case here, but it at least confirms that rebase
> >>--preserve-merges was not meant to reorder commits.
> >>
> >>See [this][1] thread for more background on this limitation.
> >>
> >>[0]: https://git-scm.com/docs/git-rebase#_bugs
> >>[1]: https://public-inbox.org/git/1mtveu4.19lvgi1c0hmhaM%25lists@haller-berlin.de/
> >
> > This is it. As I understand git-rebase--helper is an attempt to fix the bug.
> > But it's still in development, isn't it?
> 
> The impression I have been getting is that "rebase -p" was abandoned
> by its author, and the recent rebase--helper work is solely for
> re-implementing the performance sensitive part of "-i" (interactive).

Indeed. The design of `-p` does not really allow for it to be fixed, as it
overloads the meaning of `pick` to also "pick a merge commit". This
further limits the usefulness of the `-p` feature by not allowing to
adjust merge commits to merge anything else than the rebased commit^2 into
anything else than the rebased commit^, which is kind of a realy big
design bug.

But then, I never meant for -p to be interactive, either, and others made
it so. Therefore I refuse to take the blame for that.

After my rebase-i-extra patch series (which Junio currently calls
rebase-i-final) will be accepted, I plan to do a bit more work on the
rebase -i front.

One thing I have in mind is to implement a new --recreate-merges option.
It will be closely modeled after the functionality of my Git garden shears
[*1*] that I used to maintain Git for Windows' dozens of patch series on
top of git.git's `maint` branch.

Essentially, I want to introduce new commands (that are implemented as
`exec` calls in the Git garden shears, with the noticeable performance
implications on Windows) that

- allow to mark the current commit with a label,

- reset HEAD to a given label

- merge a branch by a given label

These commands would be new commands, and therefore backwards-compatible
with the current command set. No need for special-casing `pick` in the
case of the new mode.

And then I would patch in the new --recreate-merges option simply by
generating a todo list using those new commands.

The todo list may look somewhat like this:

	mark onto

	# branch <my-cool-feature>
	pick deadbee5 lay some groundwork
	pick beeb0bab implement the cool feature
	pick deebadee document the cool feature
	mark my-cool-feature

	reset onto
	pick cabbadab fix a tyop
	remerge d00beedo my-cool-feature

where `remerge <original-commit> <label>` would merge the commit with the
given label using the commit message of the original merge commit.

This would result in a history like this:

------------------------------------------ fix a tyop - Merge my-cool-feature
 \                                                    /
  lay some groundwork - implement ... - document ... -

If you have an idea for a better name than `remerge` (I do want to leave
`merge` as command to create new merge commits that have not been there
before), I'd like to hear your suggestion.

Ciao,
Johannes

Footnote *1*:
https://github.com/git-for-windows/build-extra/blob/master/shears.sh

      reply	other threads:[~2017-05-02 14:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-27  7:43 git loses a commit after reordering Nikita Orlov
2017-04-29 22:56 ` Kevin Daudt
2017-05-01 13:04   ` Re[2]: " Nikita Orlov
2017-05-01 23:33     ` Junio C Hamano
2017-05-02 14:29       ` Johannes Schindelin [this message]

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

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

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1705021608580.3480@virtualbox \
    --to=johannes.schindelin@gmx.de \
    --cc=fatemail@mail.ru \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ikke.info \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox