cursor Init 完善多人协同changelog,以及godot相关基础skill和代码规范
This commit is contained in:
23
.cursor/changelog/tools/git-hooks/post-merge
Normal file
23
.cursor/changelog/tools/git-hooks/post-merge
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
# post-merge — git merge / pull 完成后,从 fragment 源确定性重建 changelog 视图,
|
||||
# 覆盖掉 merge=union 临时产生的乱序/重复内容。
|
||||
# 若视图被重建(说明 union 留下了脏内容),提示用户提交一次。
|
||||
|
||||
ROOT=$(git rev-parse --show-toplevel 2>/dev/null) || exit 0
|
||||
cd "$ROOT" || exit 0
|
||||
|
||||
BUILD=".cursor/changelog/tools/changelog_build.py"
|
||||
[ -f "$BUILD" ] || exit 0
|
||||
|
||||
if command -v python >/dev/null 2>&1; then PY=python
|
||||
elif command -v python3 >/dev/null 2>&1; then PY=python3
|
||||
else exit 0
|
||||
fi
|
||||
|
||||
PYTHONIOENCODING=utf-8 "$PY" "$BUILD" >/dev/null 2>&1 || exit 0
|
||||
|
||||
if ! git diff --quiet -- .cursor/changelog/changelog-*.md 2>/dev/null; then
|
||||
echo "[changelog] 已从 fragment 源重建视图(merge 后清理)。请 git add + commit 这些视图文件。"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user