commit 1254511ed8947ff34b493b1733d7a4315517e05b parent a60b306e1523da863852d2e7e6fb9318e7133ac2 Author: mtmn <miro@haravara.org> Date: Tue, 16 Jun 2026 23:16:40 +0200 dotfiles: remove git/jj from prompt Diffstat:
| M | modules/mixins/dotfiles/config/shell/rc/prompt-functions | | | 74 | +------------------------------------------------------------------------- |
1 file changed, 1 insertion(+), 73 deletions(-)
diff --git a/modules/mixins/dotfiles/config/shell/rc/prompt-functions b/modules/mixins/dotfiles/config/shell/rc/prompt-functions @@ -26,64 +26,6 @@ colour_part() { fi } -_jj_prompt() { - jj_state='' - if ! jj root >/dev/null 2>&1; then - return 1 - fi - jj_wc=$(jj log -r @ --no-graph -T 'description.first_line()' 2>/dev/null | head -c 30) - jj_bookmarks=$(jj bookmark list --color never 2>/dev/null | awk '/^@ / { gsub(/:.*/, "", $2); print $2 }') - if jj status 2>/dev/null | grep -q 'conflict:'; then - jj_state='!' - fi - if [ "$jj_bookmarks" ]; then - colour_part 2 "$jj_bookmarks" - elif [ "$jj_wc" ]; then - colour_part 2 "$jj_wc" - fi - colour_part 1 "$jj_state" -} - -_git_prompt() { - local branch - local git_state - local git_head - local git_dir - local tag - - if branch="$(git rev-parse --abbrev-ref HEAD 2>/dev/null)"; then - if [ "$branch" != HEAD ]; then - git_head=$branch - elif tag="$(git describe --tags --exact-match HEAD 2>/dev/null)"; then - git_head=$tag - else - git_head=$(git rev-parse --short HEAD) - fi - - git_dir=$(git rev-parse --git-dir) - - if [ -d "$git_dir/rebase-apply" ]; then - git_state=rebase - elif [ -d "$git_dir/rebase-merge" ]; then - git_state=rebase - elif [ -f "$git_dir/MERGE_HEAD" ]; then - git_state=merge - elif [ -f "$git_dir/CHERRY_PICK_HEAD" ] || [ -f .git/sequencer/todo ]; then - git_state=cherry-pick - elif [ -f "$git_dir/REVERT_HEAD" ]; then - git_state=revert - elif [ -f "$git_dir/BISECT_LOG" ]; then - git_state=bisect - fi - fi - - [ "$git_head" = master ] && unset git_head - [ "$git_head" = main ] && unset git_head - - colour_part 2 "$git_head" - colour_part 1 "$git_state" -} - _virt_prompt() { if [ "$_VIRT" ]; then : @@ -126,31 +68,17 @@ _pwd_prompt() { colour_part 4 "${PWD##*/}" } -_vcs_prompt() { - printf '%s' "$_VCS_CACHE" -} - -_prompt_precmd() { - _VCS_CACHE=$(_jj_prompt || _git_prompt) -} - -if [ "$ZSH_VERSION" ]; then - autoload -Uz add-zsh-hook - add-zsh-hook precmd _prompt_precmd -fi - _get_ps1() { if [ "$ZSH_VERSION" ]; then prompt_ender="%(?:%%:%{${_C_1}%}%%%{${_C_RESET}%})" else prompt_ender=% fi - printf '%s%s%s%s%s%s%s ' \ + printf '%s%s%s%s%s%s ' \ "$(_devshell_prompt)" \ "$(_user_prompt)" \ "$(_hostname_prompt)" \ "$(_pwd_prompt)" \ - "$(_vcs_prompt)" \ "$(_virt_prompt)" \ "$prompt_ender" }