Previously, in PR #372, ChangeID/CommitID/IsDivergent is added to jj
log/evolog commands to allow fetching these revision metadata
natively with jj's template.
However, the change didn't take into consideration of different color
formatting of ChangeID/CommitID/IsDivergent and treated each of them as
different `screen.Segment`s.
When user configures them to be the same color,
ChangeID/CommitID/IsDivergent are actually returned as one chunk
by jj and it becomes one `screen.Segment`. Hence the previous change
breaks.
This commit updates `ChangeID/CommitID/IsDivergent` prefixes with jj's
`stringify` method, allowing them to be returned by jj consistently as
one single chunk of text without color escape sequence. this way,
`ChangeID/CommitID/IsDivergent` are always treated as one
`screen.Segment` in jjui.
Also, `_PREFIX:` is added to the template for easier separation and
parsing of prefixes.
Fixes#411
As proposed in #358, using `jj`'s native support (built-in
`change_id/commit_id/divergent`) to get ChangeID and commitID would be
more preferable than current "best guess" by checking log output
sequence in order, which breaks when a bookmark is "HexLike" and "??".
The implementation of the proposal uses `jj log`'s `-T` template option,
option for `-T` is `separate('', $prefixes, $template)`, where
`$prefixes` is `change_id.shortest(), commit_id.shortest(), divergent`
and `$template` is the user-configured template, i.e.,
`config.Current.Revisions.Template`
This way, ChangeID, CommitID, and IsDivergent for a revision are
retrieved *reliably*, and the prefixes are removed after prefix parsing
before rendering to the ui.
Fixes#358Fixes#228
Sometimes when the bookmarks are too long, or the terminal width is too
narrow, the commit id might be printed in the next line. This change
defers parsing commit id until seen if it's not already seen on the
first line.
fixes#52