oh-my-zsh snippet that shows the closest Jujutsu bookmark when you're inside a jj repo, falling back to the git branch otherwise. Prefers mutable bookmarks (your
working branches) over immutable ones (main, tags). Runs in oh-my-zsh's async-prompt background process so it doesn't block prompt redraw.
It uses git's dirty marker because jj doesn't understand submodules yet. Because of how jj log works, bookmarks that are out of sync with origin will have * appended to their names, which I think is a nice bonus.
Works with any oh-my-zsh theme that uses the standard git_prompt_info function and ZSH_THEME_GIT_PROMPT_* variables — robbyrussell, garyblessington, fwalch, and most simpler themes.