changeset 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 ec44059d05b0
children
files .shell.d/50.vcs_functions.sh
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/.shell.d/50.vcs_functions.sh
+++ b/.shell.d/50.vcs_functions.sh
@@ -100,6 +100,11 @@ function update_source_trees() {
 alias update-source-trees=update_source_trees
 
 function vcs_current_branch() {
+   local jjrev="$(jj log -r @ --no-graph -T 'change_id.shortest() ++ if(empty, "*", "")')"
+   if [ ! -z "$jjrev" ] ; then
+     echo "jj $jjrev"
+     return 0
+   fi
    git branch 2> /dev/null > /dev/null
     if [ $? = 0 ] ; then
         git branch --verbose | grep '^*' | sed 's/* //;s/ /:/;s/ .*//;s/:/ /'