git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elijah Newren <newren@gmail.com>
To: ydirson@free.fr
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [BUG] bulk move silently dropped, leaving the "delete" part in work dir, on commit reorder (rebase -i)
Date: Tue, 7 Apr 2020 13:10:26 -0700	[thread overview]
Message-ID: <CABPp-BH=XcX6tsSAu9bN-qk2h0ayj+rqmdJWwYwvCGnpKivGHw@mail.gmail.com> (raw)
In-Reply-To: <1537903963.805193304.1586275292611.JavaMail.root@zimbra39-e7>

Hi,

On Tue, Apr 7, 2020 at 9:03 AM <ydirson@free.fr> wrote:
>
> Hello all,
>
> Please find attached a fast-export test-case for the problem.  It contains an "original state" commit
> and 2 commits moving lots of files around.  As context, the first one is a logical fixup of the second
> one, adding one more move to the bulk move in the second commit.
>
> If I use "rebase -i" to reorder the 2 commits, "subject 1" which originally contains 4 blob changes and
> 324 moves, loses all the renames.  Problem exists at least in 2.25.1 and 2.26.0 as shipped in Debian testing.
>
> Additionally, the files in workdir are all locally deleted and stay there as "Changes not staged for commit",
> which should have prevented the rebase from proceeding to the second "pick".
>
>  (ref0/ref1)$ git log --raw HEAD^^..
> commit d368ee70ca358f4877185175780147b5bfba0ec5 (HEAD -> ref0/ref1)
> Author: User 0 <user0@example.com>
> Date:   Thu Apr 2 17:15:29 2020 +0200
>
>     subject 1
>
>     body
>
> :100644 100644 16fd26f 16fd26f R100     path15/path30/path89/path102/path106/path107    path15/path607/path30/path89/path102/path106/path107
>
> commit a6b4902d848acdeeb0238d22dd7a093317e7a389
> Author: User 0 <user0@example.com>
> Date:   Wed Apr 1 18:14:31 2020 +0200
>
>     subject 2
>
>     body
>
> :100644 100644 386a5e0 67bb842 M        path12/path10
> :100644 100644 703e2a3 57729f1 M        path13/path10
> :100644 100644 386a5e0 67bb842 M        path14/path10
> :100644 100644 53d9ddb fe616ea M        path9/path10
>  (ref0/ref1)$

Thanks for the report.  The testcase was slightly hard to understand
from the description at first, but it's basically:

    # download the file that Yann attached
    cat $DOWNLOADED_FILE | git fast-import --quiet
    git checkout -b testing ref0/ref1
    git rebase -i HEAD~2
    # Swap the two pick lines, save & exit editor

at which point the rebase will complete with a report of success, but
it will drop most the changes in the "subject 2" patch, and leave the
working directory quite dirty at the end despite the fact that it
started out clean.


One can also duplicate this bug using cherry-pick or merge-recursive;
for example, assuming the testing branch was already created as above:
    git reset --hard testing ref0/ref1~2
    git cherry-pick ref0/ref1


This bug goes back to at least git-2.20 and likely earlier.

I tested with the ort merge strategy and it happens to fix this bug
(among others), so maybe if rebase stuff ever quiets down then I can
address this bug just by pushing that new strategy forward.

      reply	other threads:[~2020-04-07 20:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1249625346.805132902.1586274429644.JavaMail.root@zimbra39-e7>
2020-04-07 16:01 ` [BUG] bulk move silently dropped, leaving the "delete" part in work dir, on commit reorder (rebase -i) ydirson
2020-04-07 20:10   ` Elijah Newren [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='CABPp-BH=XcX6tsSAu9bN-qk2h0ayj+rqmdJWwYwvCGnpKivGHw@mail.gmail.com' \
    --to=newren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ydirson@free.fr \
    /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;
as well as URLs for NNTP newsgroup(s).