docs: 更新命令文档和发布脚本
- 更新 release-android.md: 明确前置条件和通用项目支持 - 更新 auto-commit.md: 添加中英文 commit 信息平台选择规则 - 更新 commit-push.md: 添加中英文 commit 信息平台选择规则 - 更新 sync-oc-push.md: 添加中英文 commit 信息平台选择规则 - 更新 release-android.mjs: 支持从 tags 自动推断项目名,不再硬编码 android 前缀 - 更新 AGENTS.md: 补充中文交流规则的注意事项
This commit is contained in:
@@ -130,9 +130,13 @@ Based on changes in staging area, **analyze and generate meaningful commit messa
|
||||
- Use [Conventional Commits](https://www.conventionalcommits.org/) specification
|
||||
- Commit message should concisely but accurately describe "why" rather than just "what"
|
||||
- Common types: `feat` (new feature), `fix` (fix), `docs` (documentation), `refactor` (refactoring), `chore` (miscellaneous), `test` (test), etc.
|
||||
- **Language selection**:
|
||||
- **Default (macOS/Linux)**: Use Chinese (中文) for commit messages
|
||||
- **Windows**: Use English due to encoding issues with Cursor Shell tool
|
||||
- **If monorepo and this commit only affects single subproject, include subproject name in commit message**:
|
||||
- Format: `<type>(<scope>): <description>`, where `<scope>` is subproject name
|
||||
- Example: `feat(ios): support OGG Opus upload` or `fix(electron): fix clipboard injection failure`
|
||||
- Example (Chinese): `feat(ios): 支持 OGG Opus 上传` or `fix(electron): 修复剪贴板注入失败`
|
||||
- Example (English): `feat(ios): support OGG Opus upload` or `fix(electron): fix clipboard injection failure`
|
||||
- If affecting multiple subprojects or entire repository, no need to add scope
|
||||
|
||||
### 6. Update Project Version Number
|
||||
@@ -149,11 +153,27 @@ Based on changes in staging area, **analyze and generate meaningful commit messa
|
||||
|
||||
Execute commit with generated commit message (staging area now includes user's changes and version number update).
|
||||
|
||||
**Windows encoding issue solution:**
|
||||
**Commit message language by platform:**
|
||||
|
||||
Cursor's Shell tool has encoding issues when passing Chinese parameters on Windows, causing garbled Git commit messages.
|
||||
**macOS/Linux** (use Chinese commit messages):
|
||||
|
||||
**Correct approach**: Use **English** commit message
|
||||
```bash
|
||||
# Single line commit
|
||||
git commit -m "feat(android): 添加新功能"
|
||||
|
||||
# Multi-line commit (recommended)
|
||||
git commit -m "$(cat <<'EOF'
|
||||
feat(android): 添加新功能
|
||||
|
||||
- 详细说明 1
|
||||
- 详细说明 2
|
||||
EOF
|
||||
)"
|
||||
```
|
||||
|
||||
**Windows** (use English commit messages):
|
||||
|
||||
Due to Cursor's Shell tool encoding issues on Windows, **must use English** commit messages.
|
||||
|
||||
```powershell
|
||||
# Single line commit
|
||||
@@ -163,26 +183,12 @@ git commit -m "feat(android): add new feature"
|
||||
git commit --message="fix(android): fix code review issues" --message="- Fix syntax error" --message="- Use JSONObject instead of manual JSON"
|
||||
```
|
||||
|
||||
**Prohibited methods** (will cause garbled text):
|
||||
**Windows prohibited methods** (will cause garbled text):
|
||||
- No Chinese commit messages - Cursor Shell tool encoding error when passing Chinese parameters
|
||||
- No `Out-File -Encoding utf8` - writes UTF-8 with BOM
|
||||
- No Write tool to write temp files - encoding uncontrollable
|
||||
- No PowerShell here-string `@"..."@` - newline parsing issues
|
||||
|
||||
**For Chinese commit messages**: Please manually execute `git commit` in terminal, or use Git GUI tools other than Cursor.
|
||||
|
||||
**macOS/Linux alternative** (supports Chinese):
|
||||
|
||||
```bash
|
||||
git commit -m "$(cat <<'EOF'
|
||||
feat(android): new feature description
|
||||
|
||||
- Detail 1
|
||||
- Detail 2
|
||||
EOF
|
||||
)"
|
||||
```
|
||||
|
||||
### 8. Create Tag
|
||||
|
||||
> **Executed by default**. Only skip this step when user explicitly inputs "skip" or "skip tag".
|
||||
@@ -228,7 +234,7 @@ Examples (multi-line commit, more recommended):
|
||||
- **Create tag by default**: Unless user inputs "skip" or "skip tag", create tag by default.
|
||||
- **Update version before commit**: First determine version number and modify version file, then commit at once, avoid using `--amend`.
|
||||
- **Version file must be verified**: After updating version number and `git add`, must run `git diff --cached --name-only` to confirm version file is in staging area before executing commit.
|
||||
- **Windows encoding issues**: Cursor Shell tool garbles Chinese parameters, must use **English** commit messages. For Chinese, please manually execute in terminal.
|
||||
- **Commit message language**: Default use Chinese (macOS/Linux); Windows must use English due to Cursor Shell tool encoding issues.
|
||||
- **monorepo scope**: If staging area only affects single subproject, commit message should have scope; if affecting multiple subprojects, no scope needed.
|
||||
- **monorepo tag format**: Use `<subproject>-<version>` format (e.g., `ios-0.1.0`, `android-1.1.0`).
|
||||
- **No version file case**: If project type cannot be identified or no version file (like pure Go project), only create git tag, don't update any files.
|
||||
|
||||
Reference in New Issue
Block a user