leanprover-community / mathport

Mathport is a tool for porting Lean3 projects to Lean4
Apache License 2.0
40 stars 15 forks source link

Use last-changed SHAs instead of HEAD shas #230

Closed eric-wieser closed 1 year ago

eric-wieser commented 1 year ago

This changes the SHA in the file header to refer to the last commit at which the Lean3 file was changed (at or before the revision used by mathport), rather than always pointing at the latest revision. This means that mathport will no longer update every single file every time it runs on a new version of mathlib3.

Advantages of this approach:

Disadvantages of this approach:

Tested by looking at the CI output and verifying the sha for algebra/algebra/basic.lean points to the expected commit.


eric-wieser commented 1 year ago

This now uses https://github.com/leanprover-community/mathlib/commit/4ea65cad5ad088877e021da13201d55a93c92366 for algebra/algebra/basic.lean instead of the https://github.com/leanprover-community/mathlib/commit/28aa996fc6fb4317f0083c4e6daf79878d81be33 which is used in mathlib3port

So this seems to be working as intended.

eric-wieser commented 1 year ago

Discussed on Zulip here

gebner commented 1 year ago

@eric-wieser This PR broke CI.

find sources/lean/library/ -name "*.ast.json" -o -name "*.tlean" -o -name upstream-rev -o file-revs.json | tar -czvf lean3-predata.tar.gz -T -
find: paths must precede expression: `file-revs.json'
find sources/mathlib/ -name "*.ast.json" -o -name "*.tlean" -o -name upstream-rev -o file-revs.json | tar -czvf mathlib3-predata.tar.gz -T -
find: paths must precede expression: `file-revs.json'
eric-wieser commented 1 year ago

Whoops, sorry. I think Mario pushed a fix.