git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Sebastian Schuberth <sschuberth@gmail.com>
Cc: "Martin Ågren" <martin.agren@gmail.com>,
	"Git Mailing List" <git@vger.kernel.org>
Subject: Re: Commit dropped when swapping commits with rebase -i -p
Date: Fri, 1 Sep 2017 17:04:17 -0700	[thread overview]
Message-ID: <20170902000417.GE143138@aiede.mtv.corp.google.com> (raw)
In-Reply-To: <CAHGBnuMC_10krsdZe2KiQ4jjiL43kogn--dWjPgca_p2xgmQMA@mail.gmail.com>

Hi,

Sebastian Schuberth wrote:
> On Wed, Aug 30, 2017 at 8:07 PM, Martin Ågren <martin.agren@gmail.com> wrote:

>> The man-page for git rebase says that combining -p with -i is "generally
>> not a good idea unless you know what you are doing (see BUGS below)".
>
> Thanks for pointing this out again. I remember to have read this some
> time ago, but as I general consider myself to know what I'm doing, I
> forgot about it :-)

Heh.

> Anyway, this should really more explicitly say *what* you need to know
> about, that is, reordering commits does not work.

It tries to explain that, even with an example.  If you have ideas for
improving the wording, that would be welcome.

That said, ...

>> So if you agree that a "dropped commit" is a "counterintuitive result",
>> this is known and documented. Maybe the warning could be harsher, but it
>> does say "unless you know what you are doing".
>
> I'd say it's worse than counterintuitive, as counterintuitive might
> still be correct, while in my case it clearly is not. So yes, the
> warning must be harsher in my opinion. Maybe we should even abort
> rebase -i-p if reordering of commits is detected.

This sounds like a more promising approach.  If you can detect when
the rebase -i -p is going to cause trouble, then I would be all for
aborting.  If you want to be extra nice to people, you can provide a
--force escape valve to let them experience the broken behavior, but I
don't think that is necessary.

I also think a loud warning when -i -p is used even when it is not
going to cause trouble would be a valuable change.  E.g. maybe the
template that opens in the editor could say something about reordering
commits not being advisable?

E.g. I could imagine the todo list including some instructions in the
spirit of

	# git rebase --preserve-merges does not support reordering commits.
	# To attempt reordering anyway, add a line with the text "reorder".
	# It is not likely to behave as you expect.  You have been
	# warned.

Thanks,
Jonathan

  reply	other threads:[~2017-09-02  0:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 10:11 Commit dropped when swapping commits with rebase -i -p Sebastian Schuberth
2017-08-30 18:07 ` Martin Ågren
2017-08-30 18:59   ` Sebastian Schuberth
2017-09-02  0:04     ` Jonathan Nieder [this message]
2017-09-11  8:45       ` Sebastian Schuberth
2017-09-15 20:52         ` Junio C Hamano
2017-09-16 10:41           ` Andreas Heiduk
2017-09-16 13:45             ` Sebastian Schuberth
2017-09-17 13:31               ` Phillip Wood
2017-08-30 20:28 ` Johannes Schindelin
2017-08-30 20:48   ` Sebastian Schuberth
2017-09-01 19:16     ` Johannes Schindelin

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=20170902000417.GE143138@aiede.mtv.corp.google.com \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=martin.agren@gmail.com \
    --cc=sschuberth@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).