summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGereon Kremer <nafur42@gmail.com>2021-06-02 08:29:02 +0200
committerGitHub <noreply@github.com>2021-06-02 06:29:02 +0000
commit444487219984b510bfe8c95c25fd8d28466551d5 (patch)
tree67f61e0bd44191360690b503e645809c8f775217
parent245d3383c2f463b07987f2758af28871fe753de9 (diff)
Do manual squash cleanup for docs (#6646)
This PR abandons the attempt to do the cleanup in a single rebase command, and instead squashes the old commits manually. The current solution does not handle conflicts properly. The new approach (which seems to be more robust) proceeds as follows (to squash $first..$last): - checkout $last - soft reset to $first (checkout $first, but keep changes in working copy) - commit to squashed commit - cherry-pick $last..HEAD from main branch
-rw-r--r--.github/workflows/docs_cleanup.yml8
1 files changed, 6 insertions, 2 deletions
diff --git a/.github/workflows/docs_cleanup.yml b/.github/workflows/docs_cleanup.yml
index f56a0f595..761736e75 100644
--- a/.github/workflows/docs_cleanup.yml
+++ b/.github/workflows/docs_cleanup.yml
@@ -36,6 +36,7 @@ jobs:
touch -d "$mod" $file
done
find ./ -maxdepth 1 -name "docs-*" -mtime +7 -exec git rm -r {} +
+ find ./ -maxdepth 1 -name "docs-*" -xtype l -exec git rm {} +
git commit -m "Prune docs" || echo "Nothing to prune"
- name: Squash old commits
@@ -47,7 +48,10 @@ jobs:
first=`git rev-list --max-parents=0 HEAD`
last=`git rev-list --until=1.month.ago -n1 HEAD`
if [ -n "$last" ]; then
- git rebase -Xtheirs --onto $first $last
+ git checkout $last
+ git reset --soft $first
+ git commit -m "Squash old history"
+ git cherry-pick $last..main
git log
fi
@@ -66,4 +70,4 @@ jobs:
git commit -m "Update README.md"
fi
- git push -f
+ git push -f origin HEAD:main
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback