Merge pull request #49 from Molecule-AI/fix/precommit-skip-rebase
Some checks failed
Publish to PyPI / build-and-publish (push) Failing after 40s

fix(precommit): skip during rebase/cherry-pick/merge/revert — unblocks DIRTY PR rebase
This commit is contained in:
Hongming Wang 2026-04-24 04:35:19 -07:00 committed by GitHub
commit a80294766c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 1 deletions

View File

@ -27,6 +27,22 @@ if [ -z "${GIT_AUTHOR_NAME:-}${GIT_COMMITTER_NAME:-}" ]; then
exit 0
fi
# Skip during rebase / cherry-pick / merge / revert — these REPLAY existing
# commits and the staged file set is whatever was already committed
# upstream. Blocking those forces the agent to manually rewrite history
# (interactive rebase + manual file deletion + commit amend) which most
# agents won't do — net effect was 15+ DIRTY PRs sitting unmergeable on
# molecule-core after the hook landed (cycle 107 trace, 2026-04-24).
#
# Detection via .git state directories. These exist only during the
# corresponding operation and get cleaned up at the end.
GIT_DIR=$(git rev-parse --git-dir 2>/dev/null || echo .git)
for state_dir in rebase-merge rebase-apply CHERRY_PICK_HEAD MERGE_HEAD REVERT_HEAD; do
if [ -e "${GIT_DIR}/${state_dir}" ]; then
exit 0
fi
done
# Determine if we're in a public Molecule-AI repo. `git remote get-url`
# returns nothing in repos without a remote (fine — exit clean).
REMOTE=$(git remote get-url origin 2>/dev/null || echo "")

View File

@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "molecule-ai-workspace-runtime"
version = "0.1.13"
version = "0.1.14"
description = "Molecule AI workspace runtime — shared infrastructure for all agent adapters"
requires-python = ">=3.11"