# History mode for Pkg

**URL:** <https://discourse.julialang.org/t/history-mode-for-pkg/70256>\
**Category:** Package Management\
**Created:** [October 23, 2021, 8:04am UTC](https://discourse.julialang.org/t/history-mode-for-pkg/70256 "2021-10-23T08:04:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [October 23, 2021, 8:04am UTC](https://discourse.julialang.org/t/history-mode-for-pkg/70256/1 "2021-10-23T08:04:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [October 23, 2021, 8:05am UTC](https://discourse.julialang.org/t/history-mode-for-pkg/70256/2 "2021-10-23T08:05:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [October 23, 2021, 8:06am UTC](https://discourse.julialang.org/t/history-mode-for-pkg/70256/3 "2021-10-23T08:06:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [October 23, 2021, 10:43am UTC](https://discourse.julialang.org/t/history-mode-for-pkg/70256/4 "2021-10-23T10:43:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [October 23, 2021, 11:36am UTC](https://discourse.julialang.org/t/history-mode-for-pkg/70256/5 "2021-10-23T11:36:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [October 23, 2021, 12:13pm UTC](https://discourse.julialang.org/t/history-mode-for-pkg/70256/6 "2021-10-23T12:13:51Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [October 23, 2021, 1:01pm UTC](https://discourse.julialang.org/t/history-mode-for-pkg/70256/7 "2021-10-23T13:01:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [October 23, 2021, 7:22pm UTC](https://discourse.julialang.org/t/history-mode-for-pkg/70256/8 "2021-10-23T19:22:03Z")

</div>

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