This commit is contained in:
parent
472d9b0b05
commit
8694c7d81f
3 changed files with 70 additions and 137 deletions
|
|
@ -21,50 +21,4 @@
|
|||
nix-hash --type sha256 --to-base64 (nix-prefetch-url $argv)
|
||||
'';
|
||||
};
|
||||
fish_jj_prompt = {
|
||||
body = ''
|
||||
if not command -sq jj
|
||||
return 1
|
||||
end
|
||||
if not command -sq timeout
|
||||
return 1
|
||||
end
|
||||
if set -q FISH_JJ
|
||||
return 0
|
||||
end
|
||||
if not jj workspace root --ignore-working-copy &>/dev/null
|
||||
return 1
|
||||
end
|
||||
|
||||
# Generate prompt
|
||||
set -l info "$(
|
||||
timeout 5 jj log --ignore-working-copy --no-graph --color=always --revisions=@ --template "
|
||||
separate(
|
||||
' ',
|
||||
self.change_id().shortest(),
|
||||
bookmarks.join(', '),
|
||||
if(conflict, label('conflict', '×')),
|
||||
if(empty, label('empty', '(empty)')),
|
||||
if(divergent, label('divergent', '(divergent)')),
|
||||
if(hidden, label('hidden', '(hidden)')),
|
||||
)
|
||||
"
|
||||
)"
|
||||
or return 1
|
||||
|
||||
if test -n $info
|
||||
printf ' (jj: %s)' $info
|
||||
else
|
||||
return 1
|
||||
end
|
||||
'';
|
||||
};
|
||||
fish_vcs_prompt = {
|
||||
body = ''
|
||||
fish_jj_prompt $argv
|
||||
or fish_git_prompt $argv
|
||||
or fish_hg_prompt $argv
|
||||
or fish_fossil_prompt $argv
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue