Loading...
Loading...
Compare original and translation side by side
references/se-principles.mdreferences/anti-patterns.mdse-principles.mdreferences/se-principles.mdreferences/anti-patterns.mdse-principles.md| Scope | Git Commands | When to Use |
|---|---|---|
| Feature branch | | User is on a non-main branch (default) |
| Last N commits | | User specifies a range, or on main (default N=5) |
| Specific commit | | User references a specific commit |
| Working changes | | User says "what about these changes?" before committing |
| 范围 | Git命令 | 适用场景 |
|---|---|---|
| 功能分支 | | 用户处于非主分支(默认情况) |
| 最近N次提交 | | 用户指定了范围,或处于主分支(默认N=5) |
| 特定提交 | | 用户提及了特定提交 |
| 本地未提交变更 | | 用户询问“这些变更怎么样?”且尚未提交时 |
git loggit diffgit diff --statgit loggit diffgit diff --statreferences/se-principles.mdreferences/se-principles.mdundefinedundefined
If there is a second lesson worth noting (maximum 2 additional):
```markdown
---
若还有第二个值得提及的经验(最多额外2个):
```markdown
---undefinedundefined| Avoid | Why | Instead |
|---|---|---|
| Listing every principle that vaguely applies | Overwhelming and generic | Pick the 1-2 most relevant |
| Analyzing files that were not changed | Scope creep | Stick to the diff |
| Ignoring commit messages | They contain intent that diffs miss | Read them as primary context |
| Abstract advice disconnected from the code | Not actionable | Always reference specific files/lines |
| Negative-only feedback | Demoralizing | Lead with what works, then suggest improvements |
| More than 3 lessons | Dilutes the insight | One well-grounded lesson beats seven vague ones |
| 需避免的行为 | 原因 | 正确做法 |
|---|---|---|
| 罗列所有沾边的原则 | 过于冗余且空泛 | 选择1-2个最相关的原则 |
| 分析未发生变更的文件 | 超出分析范围 | 仅关注差异内容 |
| 忽略提交信息 | 其中包含了差异无法体现的意图 | 将提交信息作为主要上下文来阅读 |
| 给出脱离代码的抽象建议 | 不具备可操作性 | 始终引用具体文件/行号 |
| 只给出负面反馈 | 打击积极性 | 先肯定做得好的地方,再提出改进建议 |
| 总结超过3条经验 | 分散核心观点 | 一个有扎实依据的经验胜过七个空泛的结论 |