Skip to content

Commit 4f0ebac

Browse files
author
Matthias Koeppe
committed
.github/workflows/{build,doc-build}.yml: Fix handling of added files
1 parent 3230f00 commit 4f0ebac

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,13 @@ jobs:
6060
# (This keeps mtimes of unchanged files unchanged and mtimes of changed files newer than unchanged files.)
6161
# Finally we reset the index to "old". (This keeps all mtimes unchanged.)
6262
# The changed files now show up as uncommitted changes.
63+
# The final "git add -N" makes sure that files that were added in "new" do not show
64+
# as untracked files, which would be removed by "git clean -fx".
6365
git worktree add --detach worktree-image
6466
rm -rf /sage/.git && mv worktree-image/.git /sage/
6567
rm -rf worktree-image && ln -s /sage worktree-image
6668
if [ ! -f worktree-image/.gitignore ]; then cp .gitignore worktree-image/; fi
67-
(cd worktree-image && git add -A && git commit --allow-empty -m "old" -a && git tag -f old && git reset --hard new && git reset old)
69+
(cd worktree-image && git add -A && git commit --quiet --allow-empty -m "old" -a && git tag -f old && git reset --hard new && git reset --quiet old && git add -N . && git status)
6870
6971
- name: Incremental build, test changed files (sage -t --new)
7072
id: incremental

.github/workflows/doc-build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ jobs:
4444
# (This keeps mtimes of unchanged files unchanged and mtimes of changed files newer than unchanged files.)
4545
# Finally we reset the index to "old". (This keeps all mtimes unchanged.)
4646
# The changed files now show up as uncommitted changes.
47+
# The final "git add -N" makes sure that files that were added in "new" do not show
48+
# as untracked files, which would be removed by "git clean -fx".
4749
git worktree add --detach worktree-image
4850
rm -rf /sage/.git && mv worktree-image/.git /sage/
4951
rm -rf worktree-image && ln -s /sage worktree-image
5052
if [ ! -f worktree-image/.gitignore ]; then cp .gitignore worktree-image/; fi
51-
(cd worktree-image && git add -A && git commit --allow-empty -m "old" -a && git tag -f old && git reset --hard new && git reset old)
53+
(cd worktree-image && git add -A && git commit --quiet --allow-empty -m "old" -a && git tag -f old && git reset --hard new && git reset --quiet old && git add -N . && git status)
5254
# Keep track of changes to built HTML
5355
(cd /sage/local/share/doc/sage/html/en && find . -name "*.html" | xargs sed -i '/class="sidebar-brand-text"/s/Sage [0-9a-z.]* /Sage dev /'; git init && (echo ".buildinfo"; echo ".inv") > .gitignore; git add -A && git commit --quiet -m "old")
5456

0 commit comments

Comments
 (0)