# HG changeset patch # User Augie Fackler # Date 1783819688 14400 # Node ID f452d7f26e04bd2062eb40738826407e1c796d2f # Parent ec44059d05b035179faec04e5074953f9cf04a66 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! diff --git a/.shell.d/50.vcs_functions.sh b/.shell.d/50.vcs_functions.sh --- 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/:/ /'