From 5ab95c724f951a8b5c2dd2cd7b6a0b32e351d139 Mon Sep 17 00:00:00 2001
From: Marty Oehme <marty.oehme@gmail.com>
Date: Sat, 22 Feb 2025 11:23:46 +0100
Subject: [PATCH] jj: Rework jj bookmark main alias

Changed into a function which takes the revision to set the bookmark to
as an argument. This should work without interfering much since the
bookmark name that the `bookmark set` function _usually_ takes as
argument is already given by the alias (always 'main') and thus we do
not have to manually provide other arguments.

It default to the current working copy just like the command and
otherwise can point to any change.
---
 vcs/jj/config/sh/alias.d/jj.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/vcs/jj/config/sh/alias.d/jj.sh b/vcs/jj/config/sh/alias.d/jj.sh
index 9bf1ff5..8e1c841 100644
--- a/vcs/jj/config/sh/alias.d/jj.sh
+++ b/vcs/jj/config/sh/alias.d/jj.sh
@@ -64,7 +64,9 @@ alias jrb="jj rebase"
 
 # 'branching' bookmark work
 alias jb="jj bookmark"
-alias jbm="jj bookmark set main"
+jbm() {
+    jj bookmark set -r "${1:-@}" main
+}
 
 # remote work
 alias jrv="jj git remote list"