fish-shell/share/functions/fish_jj_prompt.fish
Fabian Boehm 723943fd1f fish_jj_prompt: Return false if nothing was generated
That means we go on to try git etc
2025-01-13 14:54:00 +01:00

22 lines
640 B
Fish
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function fish_jj_prompt
# If jj isn't installed, there's nothing we can do
# Return 1 so the calling prompt can deal with it
if not command -sq jj
return 1
end
set -l info "$(
jj log 2>/dev/null --no-graph --ignore-working-copy --color=always --revisions @ \
--template '
separate(" ",
bookmarks,
tags,
if(conflict, label("conflict", "×")),
if(empty, label("empty", "(empty)"))
)
'
)"
or return 1
if test -n "$info"
printf ' %s' $info
end
end