mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-12 15:16:35 +00:00
19d341d32a
This creates a templater function `short_underscore_prefix` for commit and change ids. It is similar to `short` function, but shows one fewer hexadecimal digit and inserts an underscore after the shortest unique prefix. Highlighting with an underline and perhaps color/bold will be in a follow-up PR. The implementation is quadratic, a simple comparison of each id with every other id. It is replaced in a subsequent commit. The problem with it is that, while it works fine for a `jj`-sized repo, it becomes is painfully slow with a repo the size of git/git. Still, this naive implemenation is included here since it's simple, and could be used as a reference implementation. The `shortest_unique_prefix_length` function goes into `repo.rs` since that's convenient for follow-up commits in this PR to have nicer diffs. |
||
---|---|---|
.. | ||
gen-protos | ||
src | ||
tests | ||
testutils | ||
build.rs | ||
Cargo.toml |