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

Re: renormalize histroy with smudge/clean-filter

From
Elijah Newren <newren@gmail.com>
Date
Feb 8, 2025, 00:23 UTC
Message-ID
<CABPp-BFGUa_DRBe1WLVfCOKh53+F15KxW_c_OZAMwZCxuAQCiw@mail.gmail.com>
In-Reply-To
<20250207203248.GG30202@raven.inka.de>
On Fri, Feb 7, 2025 at 12:34 PM Josef Wolf <jw@raven.inka.de> wrote:
Show 10 quoted lines
>
> On Fri, Feb 07, 2025 at 06:01:43AM -0800, Elijah Newren wrote:
> > On Fri, Feb 7, 2025 at 3:13 AM Chris Torek <chris.torek@gmail.com> wrote:
>
> > 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.
>
> Sounds like trade of time against correctness?

I may have misunderstood what folks were saying in my reading & skimming of this thread. I thought some folks were suggesting

   git rebase --root -X renormalize

as a way to renormalize the history, assuming you have linear history. I was arguing against that; it's not going to work and isn't meant to[1]. I also see I didn't look closely enough at Phillip's suggestion, which was:

   git rebase --root -x 'git add --renormalize . && { git diff --quiet
--cached || git commit --amend --no-edit; }'

which will work if you do a lot of manual work to resolve line ending difference conflicts. Since the git add at each step will modify the files on which the next commit is based, that causes the application of the subsequent commit to conflict, and you probably will have difficulty seeing those conflicts since they tend to just be line ending differences. But, mixing that with Brian's suggestion, you get:

  git rebase --root -X renormalize -x 'git add --renormalize . && {
git diff --quiet --cached || git commit --amend --no-edit; }'

which should probably work if you have a linear history (though I've never tried it myself; I've never actually used the renormalization stuff beyond making sure that merge-ort matched merge-recursive). The `git add --renormalize .` does the work of changing files, and the `-X renormalize` to git allows it to handle merging subsequent commits with the munged line ending differences as it does its work.

Were you trying one of these three?  Or something else?
Elijah

[1] The renormalize option to the merge machinery ensures that new blobs produced by the merge have normalized content, and avoid conflicts when the only differences between files are normalization ones. This option does not ensure that new trees only reference new content nor that they only reference normalized content; _any_ pre-existing blobs in the repository are fair game for new trees to reference. As per the manual: "renormalize...This runs a virtual check-out and check-in of all three stages of a file when resolving a three-way merge..." So, the existing behavior of the renormalize option to rebase/cherry-pick/merge is correct. It may not be what you want, but I don't think cherry-picking/rebasing/merging with the renormalize option is the right tool for this job.

Previous: Josef WolfNext: Phillip Wood
Message 15 of 44 in “renormalize histroy with smudge/clean-filter”
  1. Josef WolfFeb 5, 2025
  2. brian m. carlsonFeb 5, 2025
  3. Josef WolfFeb 5, 2025
  4. brian m. carlsonFeb 6, 2025
  5. Elijah NewrenFeb 6, 2025
  6. Josef WolfFeb 6, 2025
  7. Josef WolfFeb 6, 2025
  8. Chris TorekFeb 7, 2025
  9. Josef WolfFeb 7, 2025
  10. Torsten BögershausenFeb 7, 2025
  11. Chris TorekFeb 7, 2025
  12. Chris TorekFeb 7, 2025
  13. Elijah NewrenFeb 7, 2025
  14. Josef WolfFeb 7, 2025
  15. Elijah NewrenFeb 8, 2025
  16. Phillip WoodFeb 8, 2025
  17. Josef WolfFeb 8, 2025
  18. Elijah NewrenFeb 8, 2025
  19. Josef WolfFeb 8, 2025
  20. D. Ben KnobleFeb 9, 2025
  21. Josef WolfFeb 9, 2025
  22. Elijah NewrenFeb 9, 2025
  23. Josef WolfFeb 9, 2025
  24. D. Ben KnobleFeb 10, 2025
  25. Josef WolfFeb 8, 2025
  26. Elijah NewrenFeb 8, 2025
  27. Josef WolfFeb 9, 2025
  28. Torsten BögershausenFeb 9, 2025
  29. Josef WolfFeb 9, 2025
  30. Josef WolfFeb 9, 2025
  31. Josef WolfFeb 9, 2025
  32. Josef WolfFeb 7, 2025
  33. Junio C HamanoFeb 7, 2025
  34. Phillip WoodFeb 6, 2025
  35. Elijah NewrenFeb 6, 2025
  36. Junio C HamanoFeb 6, 2025
  37. Josef WolfFeb 11, 2025
  38. Torsten BögershausenFeb 12, 2025
  39. Josef WolfFeb 12, 2025
  40. Collisions while cloning (was: Re: renormalize histroy with smudge/clean-filter, again)Josef Wolf, Feb 13, 2025
  41. Torsten BögershausenFeb 13, 2025
  42. Josef WolfFeb 14, 2025
  43. brian m. carlsonFeb 14, 2025
  44. Josef WolfFeb 14, 2025

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.