From 4890334eb495087506faa4ff3e20c751e94f1eca Mon Sep 17 00:00:00 2001 From: tslil Date: Thu, 13 Aug 2026 20:02:23 +0100 Subject: [jj] make a "pull" alias to dwim --- jj_config.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/jj_config.toml b/jj_config.toml index 179bb5c..d5ce62f 100644 --- a/jj_config.toml +++ b/jj_config.toml @@ -10,6 +10,18 @@ diff-formatter = ["difft", "--color=always", "$left", "$right"] tug = ["bookmark", "move", "--from", "closest_bookmark(@-)", "--to", "@-"] ml = ["log", "-r", "visible_heads() & mine()"] lf = ["log", "-r", "visible_heads()"] +pull = ["util", "exec", "--", "sh", "-c", ''' + target="$( + jj bookmark list -r 'exactly(closest_bookmark(@-), 1)' \ + -T 'name ++ "\n"' 2>/dev/null +)" || target="" + + jj git fetch || exit $? + + if [ -n "$target" ]; then + jj new "$target"; + fi; +'''] [templates] git_push_bookmark = '"tslil/push-" ++ change_id.short()' -- cgit v1.2.3