jj: allow tug to accept optional ref argument
Assisted-by: Claude Sonnet 4.5 via Claude Code
change xmmxqknunpwysomytporvorqrnnzxmou
commit 6f3ebcbcd7914e7b893aa588a8c02bc8099f4cfb
author Alpha Chen <alpha@kejadlen.dev>
date
parent ttqklyur
diff --git a/.config/jj/config.toml b/.config/jj/config.toml
index 9977c93f..3ae0d329 100644
--- a/.config/jj/config.toml
+++ b/.config/jj/config.toml
@@ -95,7 +95,10 @@ edit = true
 [aliases]
 accuse = ["file", "annotate"]
 jj = []
-tug = ["bookmark", "move", "--from", "closest_bookmark(@)", "--to", "closest_pushable(@)"]
+tug = ["util", "exec", "--", "bash", "-c", """
+  ref=${1:-@}
+  jj bookmark move --from "closest_bookmark($ref)" --to "closest_pushable($ref)"
+""", ""]
 stack = ["rebase", "-A", "trunk()", "-B", "closest_merge(@)", "-r"]
 pr = ["util", "exec", "--", "bash", "-c", """
   gh pr create --head \