git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Marco Giuliano <marco.giuliano@tesisquare.com>
To: Elijah Newren <newren@gmail.com>
Cc: Phillip Wood <phillip.wood@dunelm.org.uk>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Nonexistent changes appear rebasing but only with rebase.backend=apply
Date: Tue, 29 Jun 2021 20:58:21 +0200	[thread overview]
Message-ID: <CANLwWg7Y4yH=yQYt3d7xH-LDfiZgbiMpHb9uxSJ=xT12s2WnrQ@mail.gmail.com> (raw)
In-Reply-To: <CABPp-BH1COE8worEAuu3M_LNJfVhW3Y6+1r8zfUcVaTrVgjG5w@mail.gmail.com>

On Sat, Jun 26, 2021 at 9:53 AM Elijah Newren <newren@gmail.com> wrote:
>
> Hi Marco,
>
> On Fri, Jun 25, 2021 at 12:15 AM Marco Giuliano
> <marco.giuliano@tesisquare.com> wrote:
> >
> > Hi Philip,
> > oh, so I guessed correctly...
> > Could you be more specific about the copy/rename issue of the apply backend ?
> > Is there any bug report I can refer to ?
> >
> > Thank you very much for your support
>
> Could you do us a favor?  Please avoid top-posting and instead answer
> after the quoted original text, much like I'll do here...
>
> > On Thu, Jun 24, 2021 at 8:39 PM Phillip Wood <phillip.wood123@gmail.com> wrote:
> > >
> > > Hi Marco
> > >
> > > On 24/06/2021 17:23, Marco Giuliano wrote:
> > > > Thanks Felipe and Philip for your answers.
> > > >
> > > > Let's proceed in order:
> > > > @Felipe: I tried rebasing with --no-fork-point but the problem remains the same
> > > >
> > > > @Philip:
> > > > I'm a basic git user, so bear with me if I say silly things...
> > > > I tried to search for rebased-patches in .git folder when rebase
> > > > stopped waiting for
> > > > conflict resolution, but I didn't find any file named like that.
> > > > There's a folder named rebase-apply though did you mean that ?
> > >
> > > Looking at the source I thought they ended up just in .git but I haven't
> > > checked again, as you seem to have found the source of the problem below
> > > lets not worry about that.
> > >
> > > > Anyway, looking at the conflict file of "fileA" directly (not behind a
> > > > visual diff tool) I noticed that the marker line >>>>>>>> COMMIT
> > > > DESCR: FILENAME indicates a different file name then the current
> > > > conflicted file.
> > > > That reminded me that those two files A & B, were actually copies
> > > > (real copy, not symlink) of other two files inside the same repo.
> > > > Is it somehow possible that auto-detected-renaming is involved in this
> > > > (since the files are identical but in two different locations) ?
> > > > Trying to give you some hints, maybe it is totally unrelated...
> > >
> > > I meant to ask if anything had been copied or renamed but forgot. The
> > > merge backend detects copies and renames and handles them correctly but
> > > the apply backend does not so I think this is the source of the discrepancy.
> > >
>
> So I've got a hunch here.  First, Marco, from your example, can you run
>
> git diff --name-status -C Y...X
>
> and report whether the files involved were either renamed or copied on
> the upstream side of history.  (Also, please note that there are three
> dots between Y and X)  Also, can you report whether a message of the
> form "inexact rename detection was skipped due to too many files" when
> using the merge backend and that files you copied from end up in
> modify/delete conflicts when using the merge backend?
>
>
> My suspicion is:
> * You both renamed some files and copied them on the upstream side of history
> * You made further changes to the renamed files, more so than to the "copies"
> * You have enough added/removed/renamed files that with the merge
> backend you are triggering merge.renameLimit and not getting rename
> detection, causing various reports of modify/delete conflicts
> * The apply backend's use of fake trees can be viewed as a poor-man's
> version of the irrelevant rename detection optimization I added to
> merge-ort, but it works well enough to get you under merge.renameLimit
> so that renames are detected for the apply backend
> * The fact that you modified what you view as renames more than what
> you viewed as copies has the perverse effect of causing git's rename
> detection to pair up files with the copy rather than the rename, and
> apply changes to it
>
> The net result is that the 'merge' backend isn't apply your changes
> from various files to their renamed counterpart, while the 'apply'
> backend is almost doing that but applying them to what you think of as
> the copy rather than the intended renamed file.  The questions I asked
> above may be able to help us either confirm or rule out this theory.


Hi Elijah,
sorry for the top posting.

I tried the 3-dots command, but no changes on those 2 files are
reported. Neither I got any message about inexact rename detection
using the merge backend.

I think it might be something related to copy/rename/slighly-change
very similar files, but probably not exactly what you described.
Commit 4 is the result of a squash where I remember doing changes and
copies of those two files, is it possible that the squash operation
(which uses rebase under the hood) somehow nullified some of those
changes because of their similarities and the current rebase-apply
made them reappear ?

I don't know if it can be useful, but if I do an interactive rebase
(rebase -i X), even with rebase.backend=apply, the two files do not
appear among the conflicts (same as rebase.backend=merge).

Thanks for the support
Marco

  reply	other threads:[~2021-06-29 18:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 15:21 Nonexistent changes appear rebasing but only with rebase.backend=apply Marco Giuliano
2021-06-18 23:44 ` Felipe Contreras
2021-06-20 18:02 ` Phillip Wood
2021-06-24 16:23   ` Marco Giuliano
2021-06-24 18:39     ` Phillip Wood
2021-06-25  7:12       ` Marco Giuliano
2021-06-26  7:53         ` Elijah Newren
2021-06-29 18:58           ` Marco Giuliano [this message]
2021-06-25 16:08 ` Felipe Contreras

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='CANLwWg7Y4yH=yQYt3d7xH-LDfiZgbiMpHb9uxSJ=xT12s2WnrQ@mail.gmail.com' \
    --to=marco.giuliano@tesisquare.com \
    --cc=git@vger.kernel.org \
    --cc=newren@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    /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).