mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-12 04:58:57 +00:00
0debddc9e5
jj is often colocated with Git so the Git prompt also works, but jj is always in a detached HEAD state, which is atypical for Git. The jj prompt improves things by showing the revision ID which is usually more useful than the commit ID. This prompt is mostly adapted from the defaults for "jj log -r @". Showing conflicting/empty commits seems useful. Also perhaps bookmarks and tags, not sure. The main problem with this prompt is that due to --ignore-working-copy, the information may be stale. That will be rectified after every jj command, so hopefully this doesn't cause issues.
12 lines
540 B
Fish
12 lines
540 B
Fish
function fish_vcs_prompt --description "Print all vcs prompts"
|
|
# If a prompt succeeded, we assume that it's printed the correct info.
|
|
# This is so we don't try svn if git already worked.
|
|
fish_jj_prompt $argv
|
|
or fish_git_prompt $argv
|
|
or fish_hg_prompt $argv
|
|
or fish_fossil_prompt $argv
|
|
# The svn prompt is disabled by default because it's quite slow on common svn repositories.
|
|
# To enable it uncomment it.
|
|
# You can also only use it in specific directories by checking $PWD.
|
|
# or fish_svn_prompt
|
|
end
|