History mode for Pkg

I thought it could be useful to add a history mode to Pkg. The goal would be to reset the registry to the state it had at some specific date, and then all packages you add would be limited to their versions at the time. This is different from putting compat restrictions in your project toml, because you would need to find out every patch version bound of every indirect dependency to correctly replicate the same setup.

The use cases would be

  • comparing performance against the state of one year or two years ago
  • recreating setups that are missing a manifest but have a project toml without compat entries
2 Likes

How does this differ from using git on Manifest.toml?

This is not for reproducing a specific setup where you have checked in the manifest, it’s either if you’re missing that but you know when your setup was still working, or if you want to explore the ecosystem at a specific point in history.

1 Like

You can clone the registry into your .julia/registries (if it’s not already there), and then checkout a specific commit.

1 Like

Yes, this is how such a function in Pkg could be implemented.

1 Like

Yeah maybe for everybody who would even want such a function, doing this would not be a hurdle anyway. I envisioned something easily accessible like ]registry pin 2019-12-05

2 Likes

I have done this myself on occasion but it is kind of a niche function for Pkg. But there is no real need to have it inside Pkg. This would work perfectly well as a stand-alone package.

1 Like

It could be ]registry add General#61bc79d to pin a specific version of General.