Skip to content

Commit

Permalink
docs: add some scripting template examples
Browse files Browse the repository at this point in the history
Closes #4357
  • Loading branch information
yuja committed Sep 21, 2024
1 parent 0f5c553 commit b8f8827
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,3 +303,17 @@ concat(
'''
'format_field(key, value)' = 'key ++ ": " ++ value ++ "\n"'
```

## Examples

Get short commit IDs of the working-copy parents:

```sh
jj log --no-graph -r @ -T 'parents.map(|c| c.commit_id().short()).join(",")'
```

Show machine-readable list of full commit and change IDs:

```sh
jj log --no-graph -T 'commit_id ++ " " ++ change_id ++ "\n"'
```

0 comments on commit b8f8827

Please sign in to comment.