Skip to content

docs: fix jj template syntax example [AGENT]#10

Closed
utiberious wants to merge 1 commit intoutensil:mainfrom
utiberious:main
Closed

docs: fix jj template syntax example [AGENT]#10
utiberious wants to merge 1 commit intoutensil:mainfrom
utiberious:main

Conversation

@utiberious
Copy link
Copy Markdown
Contributor

问题

在 AGENTS.md 中 jj 模板的示例使用了错误的语法。

修改内容

修正 Commit discipline 部分的 jj 模板示例,将错误的 f-string 风格语法替换为正确的 jj 模板语法:

❌ 错误:jj log --no-graph -T '{commit_id} {description}'
✅ 正确:jj log --no-graph -T 'commit_id.short(7) ++ " | " ++ description.first_line()'

技术细节

  • 使用 ++ 操作符进行模板拼接
  • 展示实用方法:CommitId 的 .short()、String 的 .first_line()
  • 提供了可实际使用的示例命令

验证

已根据官方文档验证语法正确性:

- Replace incorrect template syntax: '{commit_id} {description}'
- With correct syntax: 'commit_id.short(7) ++ " | " ++ author.email().local() ++ " | " ++ description.first_line()'
- Added common field reference with link to official docs
- Common fields included: commit_id.short(), description.first_line(), author.email().local(), local_bookmarks(), empty()
- Provides practical example reducing documentation lookup needs
@utensil
Copy link
Copy Markdown
Owner

utensil commented Mar 13, 2026

Thanks! Superseded by 9d4a667 — went with a richer template covering change_id, commit_id, author name, relative timestamp, and local bookmarks.

@utensil utensil closed this Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants