From: Elijah Newren <newren@gmail.com>
To: Chris Torek <chris.torek@gmail.com>
Cc: Josef Wolf <jw@raven.inka.de>, git@vger.kernel.org
Subject: Re: renormalize histroy with smudge/clean-filter
Date: Fri, 7 Feb 2025 06:01:43 -0800 [thread overview]
Message-ID: <CABPp-BFnx2m75jsa3_kTPet97HY+xwb_6JmPiKM5+OARPy=mGA@mail.gmail.com> (raw)
In-Reply-To: <CAPx1GvcyaZqYK+SvgtfsajqtkMty1jOcVAtwfmam-LpOjyd0jw@mail.gmail.com>
On Fri, Feb 7, 2025 at 3:13 AM Chris Torek <chris.torek@gmail.com> wrote:
>
> > and (in the case of cherry-pick) there is not even any way to
> > renormalize before picking.
>
> That's mostly correct. The problem here is that while `git merge`
> (both recursive and the new ort) has a renormalize option
> internally, it's not exposed to cherry-pick.
Perhaps not as a config option, but it can be selected via -Xrenormalize .
However, whether it is exposed or used doesn't matter.
Renormalization in the merge machinery (this is the same for both the
recursive and ort backends) is something passed to xdiff[1], for doing
3-way content merges of individual files. If a
merge/rebase/cherry-pick/revert doesn't need to do a 3-way content
merge for some file, then no normalization will be done for it. This
could happen, for example, if one side of history being merged
modified a file and the other side of history being merged didn't
touch that file. And as a special case, that includes when one side
of history adds the file and the other side of history doesn't have
the file.
In particular, for the cherry-picks or rebasing that Josef is doing
going back to the root of history, that is simply doing merges against
a side of history that hasn't modified any of his files, so there
isn't going to be any automatic renormalization.
The rest of what you write about optimizations is spot on, though.
This isn't a bug in cherry-pick (or merge or rebase); renormalizing
all files proactively in the merge machinery whenever a merge or
cherry-pick is done would be orders of magnitude slower for any
decently sized repository; it's simply out of the question. I think
Phillip's suggestion elsewhere in this thread (git rebase --root -x
'git add --renormalize . && { git diff --quiet --cached || git commit
--amend --no-edit; }') would be what Josef needs to run, ASSUMING the
history Josef is operating on is linear.
Hope that helps,
Elijah
[1] Okay, technically renormalization is also used to turn
modify/delete conflicts into simple deletes, when the only
modification was a normalization of the file contents. I don't think
that's relevant to Josef's case, though, so I elided it in the
explanation.
next prev parent reply other threads:[~2025-02-07 14:01 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-05 21:47 renormalize histroy with smudge/clean-filter Josef Wolf
2025-02-05 22:55 ` brian m. carlson
2025-02-05 23:59 ` Josef Wolf
2025-02-06 0:29 ` brian m. carlson
2025-02-06 8:07 ` Elijah Newren
2025-02-06 13:40 ` Josef Wolf
2025-02-06 20:04 ` Josef Wolf
2025-02-07 6:10 ` Chris Torek
2025-02-07 10:45 ` Josef Wolf
2025-02-07 11:06 ` Torsten Bögershausen
2025-02-07 11:12 ` Chris Torek
2025-02-07 11:17 ` Chris Torek
2025-02-07 14:01 ` Elijah Newren [this message]
2025-02-07 20:32 ` Josef Wolf
2025-02-08 0:23 ` Elijah Newren
2025-02-08 11:14 ` Phillip Wood
2025-02-08 21:08 ` Josef Wolf
2025-02-08 21:43 ` Elijah Newren
2025-02-08 23:26 ` Josef Wolf
2025-02-09 2:33 ` D. Ben Knoble
2025-02-09 8:53 ` Josef Wolf
2025-02-09 7:21 ` Elijah Newren
2025-02-09 8:57 ` Josef Wolf
2025-02-10 17:51 ` D. Ben Knoble
2025-02-08 20:57 ` Josef Wolf
2025-02-08 21:56 ` Elijah Newren
2025-02-09 9:25 ` Josef Wolf
2025-02-09 11:14 ` Torsten Bögershausen
2025-02-09 15:09 ` Josef Wolf
2025-02-09 17:54 ` Josef Wolf
2025-02-09 18:01 ` Josef Wolf
2025-02-07 20:21 ` Josef Wolf
2025-02-07 15:39 ` Junio C Hamano
2025-02-06 10:13 ` Phillip Wood
2025-02-06 7:55 ` Elijah Newren
2025-02-06 19:00 ` Junio C Hamano
2025-02-11 23:57 ` renormalize histroy with smudge/clean-filter, again Josef Wolf
2025-02-12 6:12 ` Torsten Bögershausen
2025-02-12 8:18 ` Josef Wolf
2025-02-13 11:36 ` Collisions while cloning (was: Re: renormalize histroy with smudge/clean-filter, again) Josef Wolf
2025-02-13 16:40 ` Torsten Bögershausen
2025-02-14 20:03 ` renormalize histroy with smudge/clean-filter, again Josef Wolf
2025-02-14 20:21 ` brian m. carlson
2025-02-14 20:55 ` Josef Wolf
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-BFnx2m75jsa3_kTPet97HY+xwb_6JmPiKM5+OARPy=mGA@mail.gmail.com' \
--to=newren@gmail.com \
--cc=chris.torek@gmail.com \
--cc=git@vger.kernel.org \
--cc=jw@raven.inka.de \
/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).