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

Re: Commit dropped when swapping commits with rebase -i -p

From
Sebastian Schuberth <sschuberth@gmail.com>
Date
Sep 11, 2017, 08:45 UTC
Message-ID
<a47058cc-8ffc-4484-c247-3c8d4f827c07@gmail.com>
In-Reply-To
<20170902000417.GE143138@aiede.mtv.corp.google.com>
On 2017-09-02 02:04, Jonathan Nieder wrote:
Show 5 quoted lines
>> 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.
As a first step, I indeed believe the wording must the stronger / clearer. How about this:
From f69854ce7b9359603581317d152421ff6d89f345 Mon Sep 17 00:00:00 2001
From: Sebastian Schuberth <sschuberth@gmail.com>
Date: Mon, 11 Sep 2017 10:41:27 +0200
Subject: [PATCH] docs: use a stronger wording when describing bugs with rebase -i -p
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
---
 Documentation/git-rebase.txt | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 6805a74aec..ccd0a04d54 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -782,10 +782,11 @@ case" recovery too!
 
 BUGS
 ----
-The todo list presented by `--preserve-merges --interactive` does not
-represent the topology of the revision graph.  Editing commits and
-rewording their commit messages should work fine, but attempts to
-reorder commits tend to produce counterintuitive results.
+Be careful when combining the `-i` / `--interactive` and `-p` /
+`--preserve-merges` options.  Reordering commits will drop commits from the
+main line. This is because the todo list does not represent the topology of the
+revision graph in this case.  However, editing commits and rewording their
+commit messages 'should' work fine.
 
 For example, an attempt to rearrange
 ------------
-- 
2.14.1.windows.1
Previous: Jonathan NiederNext: Junio C Hamano
Message 5 of 12 in “Commit dropped when swapping commits with rebase -i -p”
  1. Sebastian SchuberthAug 30, 2017
  2. Martin ÅgrenAug 30, 2017
  3. Sebastian SchuberthAug 30, 2017
  4. Jonathan NiederSep 2, 2017
  5. Sebastian SchuberthSep 11, 2017
  6. Junio C HamanoSep 15, 2017
  7. Andreas HeidukSep 16, 2017
  8. Sebastian SchuberthSep 16, 2017
  9. Phillip WoodSep 17, 2017
  10. Johannes SchindelinAug 30, 2017
  11. Sebastian SchuberthAug 30, 2017
  12. Johannes SchindelinSep 1, 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.