Skip to content

Conversation

@mitchellwrosen
Copy link
Member

@mitchellwrosen mitchellwrosen commented Nov 26, 2025

Overview

This PR implements a simple "canonicalize names" step before synhashing (for diff / merge calculations). The intention is to make changes to library dependencies (i.e. upgrades) register as propagated updates.

The existing (trunk) implementation of synhashing, omitting a couple minor details, considers two terms synhash-equal if they render the same (without suffixification).

That mostly works, but not for when one branch swaps out one library for another whilst also changing the library's name (e.g. lib.base_1_0_0 -> lib.base_2_0_0).

In this PR, we simply form a canonicalization step (for the pretty-print environment used in synhashing) for names of the form lib.*_X_Y_Z.*, where X, Y, and Z are numbers. For example, lib.base_1_0_0.data.List.map gets canonicalized to lib.base.data.List.map. This matches how we mangle released libraries with semantic version numbers.

Test coverage

I added a transcript to branch.diff.md to demonstrate that we don't classify library upgrades as propagated updates, when the library names fit the _X_Y_Z mold. I also inspected synhashes manually at the command line.

Loose ends

We'll want to bump Share too, so it can perform the same canonicalization when producing diffs

@mitchellwrosen mitchellwrosen marked this pull request as ready for review December 3, 2025 18:05
@aryairani aryairani merged commit dea1d00 into trunk Dec 4, 2025
31 checks passed
@aryairani aryairani deleted the 25-11-24-canonicalize-libnames-for-synhashing branch December 4, 2025 02:23
@aryairani
Copy link
Contributor

Was there a ticket to close for this or no

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants