comparison .shell.d/50.vcs_functions.sh @ 532:f452d7f26e04 default tip

vcs_functions: add jj status to current branch info This causes jj info to show up in my prompt. The first change to this since 2018!
author Augie Fackler <raf@durin42.com>
date Sat, 11 Jul 2026 21:28:08 -0400
parents fff281929b47
children
comparison
equal deleted inserted replaced
531:ec44059d05b0 532:f452d7f26e04
98 done 98 done
99 } 99 }
100 alias update-source-trees=update_source_trees 100 alias update-source-trees=update_source_trees
101 101
102 function vcs_current_branch() { 102 function vcs_current_branch() {
103 local jjrev="$(jj log -r @ --no-graph -T 'change_id.shortest() ++ if(empty, "*", "")')"
104 if [ ! -z "$jjrev" ] ; then
105 echo "jj $jjrev"
106 return 0
107 fi
103 git branch 2> /dev/null > /dev/null 108 git branch 2> /dev/null > /dev/null
104 if [ $? = 0 ] ; then 109 if [ $? = 0 ] ; then
105 git branch --verbose | grep '^*' | sed 's/* //;s/ /:/;s/ .*//;s/:/ /' 110 git branch --verbose | grep '^*' | sed 's/* //;s/ /:/;s/ .*//;s/:/ /'
106 return 0 111 return 0
107 fi 112 fi