gjalla-prepare-and-commit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Make your changes commit-ready

让你的变更可提交

Turn a working change into a committable change that reviewers and future readers can trust.
将已完成的变更转化为可提交的版本,让代码评审人员和未来的阅读者能够放心使用。

1. Review what you implemented

1. 检查你的实现内容

  • Are all verification criteria and expected outcomes met?
  • Is the implementation complete (no dummy data or placeholder stubs left)?
  • Are all of the gjalla rules met?
  • Does this elegantly build on top of / within the existing state/architecture/properties?
  • Does it match the plan / gjalla spec?
  • Are positive, negative, and edge cases saliently tested?
  • 是否满足所有验证标准和预期结果?
  • 实现是否完整(未遗留虚拟数据或占位存根)?
  • 是否符合所有gjalla规则?
  • 是否能优雅地基于现有状态/架构/特性进行构建?
  • 是否与计划/gjalla规范一致?
  • 是否充分测试了正常、异常及边缘场景?

2. Make a commit plan

2. 制定提交计划

  • One logical change per commit. If the diff does two unrelated things, don't be afraid to split it (
    git add -p
    ).
  • Ensure you're committing to the right branch and/or following the expected branching strategy.
  • Prepare what you will report to git (description of the lines of code that are changing) and to gjalla (via attestation - properties of the system that have changed, including a reference to the gjalla spec)
  • Ensure gjalla git hooks are in place already. If they're not, your attestation and spec will not get sync'd into the master source of truth.
  • 每次提交对应一个逻辑变更。如果差异包含两个不相关的改动,不要犹豫,将其拆分(使用
    git add -p
    )。
  • 确保提交到正确的分支,且/或遵循预期的分支策略。
  • 准备好要提交给git的内容(说明代码变更的行)以及提交给gjalla的内容(通过声明——系统已变更的特性,包括gjalla规范的引用)。
  • 确保gjalla git钩子已配置到位。如果未配置,你的声明和规范将无法同步到主数据源。

3. Commit

3. 提交代码

  • Write your gjalla attestation.
    gjalla attest --example
    will show you the format, make sure to view the full output (do not run the command and pipe it 2>/dev/null for example)
  • Write your commit message and run your commit. Your gjalla attestatation and spec will be sync'd with gjalla as part of the git hooks, no additional work required from you.
  • Unless the user has given you blanket permission, you should likely ask the user before pushing the commit.
  • 编写你的gjalla声明。
    gjalla attest --example
    会展示格式,请确保查看完整输出(例如,不要运行命令后通过2>/dev/null屏蔽输出)。
  • 编写提交信息并执行提交。gjalla会通过git钩子自动同步你的声明和规范,无需额外操作。
  • 除非用户已明确授权,否则在推送提交前应先征得用户同意。