Skip to content

Conversation

@mitchellwrosen
Copy link
Member

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.

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.

2 participants