diff options
| author | tslil <tslil@posteo.de> | 2026-08-13 20:02:23 +0100 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-08-13 20:02:38 +0100 |
| commit | 4890334eb495087506faa4ff3e20c751e94f1eca (patch) | |
| tree | ae0d7e659c733c727407e2d6ff6c21877c54e8c4 | |
| parent | ea4bda4fa6117f9f6e59d2cbe14aad45ef72ed5f (diff) | |
[jj] make a "pull" alias to dwim
| -rw-r--r-- | jj_config.toml | 12 |
1 files changed, 12 insertions, 0 deletions
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()' |
