-
-
Save marcusandre/85e8b455c66e7c2754b33ae6d07c6b5c to your computer and use it in GitHub Desktop.
Jujutsu (jj) prompt for fish-shell and custom tide item prompt integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _tide_item_jj | |
if not command -sq jj | |
return 1 | |
end | |
if not jj root --quiet &>/dev/null | |
return 1 | |
end | |
jj log --ignore-working-copy --no-graph --color always -r @ -T ' | |
surround( | |
" (", | |
")", | |
separate( | |
" ", | |
bookmarks.join(", "), | |
coalesce( | |
surround( | |
"\"", | |
"\"", | |
if( | |
description.first_line().substr(0, 24).starts_with(description.first_line()), | |
description.first_line().substr(0, 24), | |
description.first_line().substr(0, 23) ++ "…" | |
) | |
), | |
"(no description set)" | |
), | |
change_id.shortest(), | |
commit_id.shortest(), | |
if(conflict, "(conflict)"), | |
if(empty, "(empty)"), | |
if(divergent, "(divergent)"), | |
if(hidden, "(hidden)"), | |
) | |
) | |
' | |
end |
This works really well, thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for sharing this!