Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat: do not modify the working tree when running start_port.sh #2598

Closed
wants to merge 3 commits into from

Conversation

eric-wieser
Copy link
Member

@eric-wieser eric-wieser commented Mar 3, 2023

This means that it always succeeds, even if a port has already happened. It also prevents it from clobbering local changes.
The new behavior is:

# this file is ported
$ scripts/start_port.sh Mathlib/Algebra/Algebra/Basic.lean
Checking out a new branch in a temporary working tree
Downloading latest version from mathlib3port
Applying automated fixes
Successfully created initial commits:
* 865bcb6d automated fixes
* 72c365f7 Initial file copy from mathport
* 43748fcf feat: port Algebra.Algebra.Basic

WARNING: this file has already been ported!
To continue anyway with a fresh port, you can run

    git checkout 865bcb6d548e990a7214a3a168389f731a975aa8 -b port/Algebra.Algebra.Basic-again
# this file is in progress
$ scripts/start_port.sh Mathlib/Algebra/Algebra/Operations.lean
Checking out a new branch in a temporary working tree
Downloading latest version from mathlib3port
Applying automated fixes
Successfully created initial commits:
* 66beceb7 automated fixes
* 209e1206 Initial file copy from mathport
* 250226b3 feat: port Algebra.Algebra.Operations

WARNING: The file is already in the process of being ported in mathlib4#2568.
To continue anyway with a fresh port, you can run

    git checkout 66beceb792782206d6fdf60822bffcb14779c2b0 -b port/Algebra.Algebra.Operations-<some-suffix>
# this file is not ported
$ scripts/start_port.sh Mathlib/Algebra/Algebra/Subalgebra/Basic.lean
Checking out a new branch in a temporary working tree
Downloading latest version from mathlib3port
Applying automated fixes
Successfully created initial commits:
* 93e0eb94 automated fixes
* d57e8e8f Initial file copy from mathport
* 6716afb6 feat: port Algebra.Algebra.Subalgebra.Basic

Checking out a new port/Algebra.Algebra.Subalgebra.Basic branch from 93e0eb94e59146036141385b0a94cef93dd9ffc7
M       Mathlib.lean
Switched to a new branch 'port/Algebra.Algebra.Subalgebra.Basic'
After pushing, you can open a PR at:
https://github.com/leanprover-community/mathlib4/compare/port/Algebra.Algebra.Subalgebra.Basic?expand=1&title=feat:+port+Algebra.Algebra.Subalgebra.Basic&labels=mathlib-port

The approach here is taken from https://github.com/ion1/git-plumbing-create-commit/blob/master/git-plumbing-create-commit

This mostly makes #2249 obsolete.


Open in Gitpod

This means that it always succeeds, even if a port has already happened.
It also prevents it from clobbering local changes.
@eric-wieser eric-wieser force-pushed the eric-wieser/better-start-port.sh branch from 195c48e to 84b1c2c Compare March 3, 2023 15:53
Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🎉

bors merge

@semorrison semorrison added the ready-to-merge This PR has been sent to bors. label Mar 4, 2023
bors bot pushed a commit that referenced this pull request Mar 4, 2023
This means that it always succeeds, even if a port has already happened. It also prevents it from clobbering local changes.
The new behavior is:
```sh
# this file is ported
$ scripts/start_port.sh Mathlib/Algebra/Algebra/Basic.lean
Checking out a new branch in a temporary working tree
Downloading latest version from mathlib3port
Applying automated fixes
Successfully created initial commits:
* 865bcb6d automated fixes
* 72c365f7 Initial file copy from mathport
* 43748fcf feat: port Algebra.Algebra.Basic

WARNING: this file has already been ported!
To continue anyway with a fresh port, you can run

    git checkout 865bcb6d548e990a7214a3a168389f731a975aa8 -b port/Algebra.Algebra.Basic-again
```
```sh
# this file is in progress
$ scripts/start_port.sh Mathlib/Algebra/Algebra/Operations.lean
Checking out a new branch in a temporary working tree
Downloading latest version from mathlib3port
Applying automated fixes
Successfully created initial commits:
* 66beceb7 automated fixes
* 209e1206 Initial file copy from mathport
* 250226b3 feat: port Algebra.Algebra.Operations

WARNING: The file is already in the process of being ported in mathlib4#2568.
To continue anyway with a fresh port, you can run

    git checkout 66beceb792782206d6fdf60822bffcb14779c2b0 -b port/Algebra.Algebra.Operations-<some-suffix>

```
```sh
# this file is not ported
$ scripts/start_port.sh Mathlib/Algebra/Algebra/Subalgebra/Basic.lean
Checking out a new branch in a temporary working tree
Downloading latest version from mathlib3port
Applying automated fixes
Successfully created initial commits:
* 93e0eb94 automated fixes
* d57e8e8f Initial file copy from mathport
* 6716afb6 feat: port Algebra.Algebra.Subalgebra.Basic

Checking out a new port/Algebra.Algebra.Subalgebra.Basic branch from 93e0eb94e59146036141385b0a94cef93dd9ffc7
M       Mathlib.lean
Switched to a new branch 'port/Algebra.Algebra.Subalgebra.Basic'
After pushing, you can open a PR at:
https://github.com/leanprover-community/mathlib4/compare/port/Algebra.Algebra.Subalgebra.Basic?expand=1&title=feat:+port+Algebra.Algebra.Subalgebra.Basic&labels=mathlib-port
```

The approach here is taken from https://github.com/ion1/git-plumbing-create-commit/blob/master/git-plumbing-create-commit

This mostly makes #2249 obsolete.
@bors
Copy link

bors bot commented Mar 4, 2023

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat: do not modify the working tree when running start_port.sh [Merged by Bors] - feat: do not modify the working tree when running start_port.sh Mar 4, 2023
@bors bors bot closed this Mar 4, 2023
@bors bors bot deleted the eric-wieser/better-start-port.sh branch March 4, 2023 09:53
Comment on lines -71 to -72
(echo "import $mathlib4_mod" ; cat Mathlib.lean) | LC_ALL=C sort | uniq > Mathlib.lean.tmp
mv -f Mathlib.lean.tmp Mathlib.lean
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I somehow lost these lines in the change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has been sent to bors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants