Skip to content

Commit

Permalink
sagemathgh-38676: Fix a bug in retrofit-worktree.sh
Browse files Browse the repository at this point in the history
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

as shown in https://github.com/sagemath/sage/actions/runs/10919536449/jo
b/30307397930?pr=38659, where the error message
```
[sagemath_doc_html-none] [spkg-install] [installat]
/sage/src/doc/en/installation/linux.rst: WARNING: document isn't
included in any toctree
```
is due to the file `src/doc/en/installation/linux.rst` that is not
cleaned up in the "new" branch being tested.

The problem is that the script does not clean the worktree well enough
when checking out the "new" branch.

Test: https://github.com/sagemath/sage/actions/runs/10934323900/job/3035
4225389?pr=38659, an excerpt from which  is
```
#30 6.340 + cd worktree-pre
#30 6.340 + git add -A
#30 6.989 + git commit --quiet --allow-empty -m old -a
#30 7.071 + git tag -f old
#30 7.073 + git checkout -f new
#30 7.106 Previous HEAD position was 98054dd old
#30 7.106 HEAD is now at b05f634 new
#30 7.107 + git clean -fd
#30 7.159 Removing src/doc/en/installation/linux.rst
#30 7.159 + git status
#30 7.243 HEAD detached at new
#30 7.243 nothing to commit, working tree clean
```

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#38676
Reported by: Kwankyu Lee
Reviewer(s): Matthias Köppe
  • Loading branch information
Release Manager committed Sep 27, 2024
2 parents 1543b87 + 63f5007 commit ab26b13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .ci/retrofit-worktree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ git worktree add --detach $WORKTREE_NAME
rm -rf $WORKTREE_DIRECTORY/.git && mv $WORKTREE_NAME/.git $WORKTREE_DIRECTORY/
rm -rf $WORKTREE_NAME && ln -s $WORKTREE_DIRECTORY $WORKTREE_NAME
if [ ! -f $WORKTREE_NAME/.gitignore ]; then cp .gitignore $WORKTREE_NAME/; fi
(cd $WORKTREE_NAME && git add -A && git commit --quiet --allow-empty -m "old" -a && git tag -f old && git checkout new && git status)
(cd $WORKTREE_NAME && git add -A && git commit --quiet --allow-empty -m "old" -a && git tag -f old && git checkout -f new && git clean -fd && git status)

0 comments on commit ab26b13

Please sign in to comment.