From 9e783c7478fb3121256705f23200deb60d5c94ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Sat, 10 Jan 2026 17:17:26 +0100 Subject: [PATCH] update jj and some more --- flake.lock | 8 +- programs/fish/scripts.nix | 3 +- programs/jj/default.nix | 152 +++++++++++++++++++------------------- scriptlib/scriptlib.py | 2 +- 4 files changed, 82 insertions(+), 83 deletions(-) diff --git a/flake.lock b/flake.lock index 038f4da..ba612f8 100644 --- a/flake.lock +++ b/flake.lock @@ -1007,11 +1007,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1767620081, - "narHash": "sha256-dUV88Imqgv0qsLbHUoDinzm+JAfSNKxfkozwBO8BqsQ=", + "lastModified": 1767634075, + "narHash": "sha256-dusZCtuQ0rlu0gKD+zknHRnd74OoyX6KWAMYGYDTxkE=", "ref": "refs/heads/main", - "rev": "290582a3463260181697a1e9f7cf9e490f8e8ed6", - "revCount": 2, + "rev": "1c9882a2cb6e9cbd4ba2ec0f47866c6117641c63", + "revCount": 7, "type": "git", "url": "ssh://forgejo@git.donsz.nl/jana/pipethon.git" }, diff --git a/programs/fish/scripts.nix b/programs/fish/scripts.nix index 5f00c07..465b3ea 100644 --- a/programs/fish/scripts.nix +++ b/programs/fish/scripts.nix @@ -3,10 +3,11 @@ calc = "${pkgs.custom.pipethon}/bin/python -i ${pkgs.writeText "init.py" '' import sys sys.path.append("${../../scriptlib}") - sys.path.append("${pkgs.python313Packages.numpy}/lib/python3.13/site-packages/") from scriptlib import * ''} "; + + # sys.path.append("${pkgs.python314Packages.numpy}/lib/python3.14/site-packages/") cp-media = name: media: let diff --git a/programs/jj/default.nix b/programs/jj/default.nix index 97fce63..daf252b 100644 --- a/programs/jj/default.nix +++ b/programs/jj/default.nix @@ -42,12 +42,11 @@ fsmonitor.backend = "watchman"; fsmonitor.watchman.register-snapshot-trigger = true; - revsets.log = "@ | ancestors(tronk()..(visible_heads() & mine()), 2) | tronk()"; + revsets.log = "@ | ancestors(trunk()..(visible_heads() & mine()), 2) | trunk()"; # revsets.log = "trunk()..@ | @..trunk() | trunk() | @:: | fork_point(trunk() | @)"; # revsets.log = "trunk() | ancestors(trunk()..heads(((trunk()..visible_heads()) & my() | @)::), 2)"; revset-aliases = { - "tronk()" = ''latest((present(main) | present(master)) & remote_bookmarks())''; "my()" = "user(\"${config.programs.jujutsu.settings.user.email}\")"; "user(x)" = "author(x) | committer(x)"; current = ''bookmarks() & my() & ~immutable()''; @@ -56,81 +55,7 @@ template-aliases = { "format_timestamp(timestamp)" = "timestamp.ago()"; - }; - - aliases = - let - util = script: [ - "util" - "exec" - "--" - "bash" - "-c" - script - ]; - in - { - tug = [ - "bookmark" - "move" - "--from" - "closest_bookmark(@-)" - "--to" - "@-" - ]; - tugg = [ - "bookmark" - "move" - "--from" - "closest_bookmark(@-)" - "--to" - "@" - ]; - catchup = [ - "rebase" - "-b" - "all:current" - "-d" - "tronk()" - "--skip-emptied" - ]; - pull = util '' - jj git fetch - jj catchup - ''; - ch = [ - "show" - "--stat" - ]; - move = [ - "rebase" - "-r" - ]; - ll = [ - "log" - "-T" - "builtin_log_compact" - ]; - mdiff = [ - "diff" - "--from" - "tronk()" - ]; - }; - - templates = { - log_node = '' - label("node", - coalesce( - if(!self, label("elided", "~")), - if(current_working_copy, label("working_copy", "@")), - if(conflict, label("conflict", "×")), - if(immutable, label("immutable", "*")), - label("normal", "·") - ) - ) - ''; - log = '' + log_oneline = '' if(root, format_root_commit(self), label(if(current_working_copy, "working_copy"), @@ -154,6 +79,79 @@ ) ) ''; + status_summary = "'\n' ++ self.diff().summary() ++ '\n'"; + log_oneline_with_status_summary = "log_oneline ++ if(self.current_working_copy() && self.diff().files().len() > 0, status_summary)"; + }; + + aliases = + let + util = script: [ + "util" + "exec" + "--" + "bash" + "-c" + script + ]; + in + { + tug = [ + "bookmark" + "move" + "--from" + "heads(::@- & bookmarks())" + "--to" + "coalesce(@ & ~empty(), @-)" + ]; + catchup = [ + "rebase" + "-b" + "bookmarks() & mine() & ~immutable()" + "-d" + "trunk()" + "--skip-emptied" + ]; + pull = util '' + jj git fetch + jj catchup + ''; + ch = [ + "show" + "--stat" + ]; + move = [ + "rebase" + "-r" + ]; + push = [ + "git" + "push" + ]; + ll = [ + "log" + "-T" + "builtin_log_compact" + ]; + mdiff = [ + "diff" + "--from" + "trunk()" + ]; + }; + + templates = { + log_node = '' + label("node", + coalesce( + if(!self, label("elided", "~")), + if(current_working_copy, label("working_copy", "@")), + if(conflict, label("conflict", "×")), + if(immutable, label("immutable", "*")), + label("normal", "·") + ) + ) + ''; + log = "log_oneline_with_status_summary"; git_push_bookmark = ''"jdonszelmann/" ++ change_id.short()''; }; diff --git a/scriptlib/scriptlib.py b/scriptlib/scriptlib.py index a2ce81c..7aeb23d 100644 --- a/scriptlib/scriptlib.py +++ b/scriptlib/scriptlib.py @@ -1,5 +1,5 @@ from math import *; -import numpy as np +# import numpy as np from pathlib import Path import subprocess import os