sl-commit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Smart Sapling Commit

智能Sapling提交

Create well-formatted commits following the Conventional Commits specification using Sapling SCM.
<EXTREMELY_IMPORTANT>
Windows Note: Use the full path to
sl.exe
to avoid conflicts with PowerShell's built-in
sl
alias for
Set-Location
. </EXTREMELY_IMPORTANT>
使用Sapling SCM按照约定式提交(Conventional Commits)规范创建格式规范的提交记录。
<EXTREMELY_IMPORTANT>
Windows注意事项: 请使用
sl.exe
的完整路径,避免与PowerShell内置的
Set-Location
命令的
sl
别名冲突。 </EXTREMELY_IMPORTANT>

What This Skill Does

本技能功能

  1. Checks which files have changes with
    sl status
  2. If there are untracked files to include, adds them with
    sl add
  3. Performs a
    sl diff
    to understand what changes are being committed
  4. Analyzes the diff to determine if multiple distinct logical changes are present
  5. If multiple distinct changes are detected, suggests breaking the commit into multiple smaller commits
  6. For each commit, creates a commit message using conventional commit format
  1. 使用
    sl status
    检查哪些文件有变更
  2. 如果存在需要纳入的未跟踪文件,使用
    sl add
    添加它们
  3. 执行
    sl diff
    以了解待提交的变更内容
  4. 分析diff判断是否存在多个不同的逻辑变更
  5. 如果检测到多个不同的变更,建议将提交拆分为多个更小的提交
  6. 为每个提交生成符合约定式提交格式的提交信息

Commands to Use

可用命令

  • sl status
    - Check repository state
  • sl diff
    - View pending changes
  • sl add <files>
    - Add untracked files
  • sl commit -m "<message>"
    - Create commit
  • sl status
    - 检查仓库状态
  • sl diff
    - 查看待处理变更
  • sl add <files>
    - 添加未跟踪文件
  • sl commit -m "<message>"
    - 创建提交

Key Sapling Differences from Git

Sapling与Git的核心差异

  • No staging area: Sapling commits all pending changes directly
  • Amend with auto-restack:
    sl amend
    automatically rebases descendant commits
  • Stacked Diffs: Each commit becomes a separate Phabricator diff
  • 无暂存区:Sapling直接提交所有待处理变更
  • 自动重基修改
    sl amend
    会自动变基后代提交
  • 堆叠Diff:每个提交都会成为单独的Phabricator diff

Sapling Commit Commands Reference

Sapling提交命令参考

CommandDescription
sl commit -m "message"
Create a new commit with message
sl commit -A
Add untracked files and commit
sl amend
Amend current commit (auto-rebases descendants)
sl amend --to COMMIT
Amend changes to a specific commit in stack
命令描述
sl commit -m "message"
使用指定信息创建新提交
sl commit -A
添加未跟踪文件并提交
sl amend
修改当前提交(自动变基后代提交)
sl amend --to COMMIT
将变更修改到堆叠中指定的提交

Important Notes

重要注意事项

  • Follow pre-commit checks if configured
  • Keep commits small and focused - each becomes a separate Phabricator diff
  • Use
    sl amend
    freely - Sapling handles rebasing automatically
  • Attribute AI-assisted code authorship
  • 如果配置了pre-commit检查,请遵守相关规则
  • 保持提交小而聚焦——每个提交都会成为单独的Phabricator diff
  • 可自由使用
    sl amend
    ——Sapling会自动处理变基
  • 标注AI辅助生成代码的作者归属