From 682889f8784583287f38845df505fa34406b23da Mon Sep 17 00:00:00 2001 From: Christoph Schmatzler Date: Tue, 3 Feb 2026 10:26:22 +0000 Subject: [PATCH] Replace jj with git, use lazygit in neovim --- AGENTS.md | 3 - flake.nix | 5 -- hosts/chidi/default.nix | 2 - hosts/jason/default.nix | 2 - hosts/tahani/default.nix | 2 - overlays/jj-ryu.nix | 7 -- overlays/jj-starship.nix | 1 - profiles/aerospace.nix | 76 ++++++++++---------- profiles/jjui.nix | 5 -- profiles/jujutsu.nix | 60 ---------------- profiles/neovim/default.nix | 1 - profiles/neovim/mappings.nix | 10 +-- profiles/neovim/plugins/jj-diffconflicts.nix | 14 ---- profiles/opencode/skill/vcs-detect/SKILL.md | 70 ------------------ profiles/packages.nix | 2 - profiles/starship.nix | 26 +++++-- 16 files changed, 61 insertions(+), 225 deletions(-) delete mode 100644 overlays/jj-ryu.nix delete mode 100644 overlays/jj-starship.nix delete mode 100644 profiles/jjui.nix delete mode 100644 profiles/jujutsu.nix delete mode 100644 profiles/neovim/plugins/jj-diffconflicts.nix delete mode 100644 profiles/opencode/skill/vcs-detect/SKILL.md diff --git a/AGENTS.md b/AGENTS.md index cf3a386..bcbee4b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,8 +1,5 @@ # AGENTS.md -## ⚠️ VERSION CONTROL: JUJUTSU (jj) ONLY -**NEVER run git commands.** This repo uses Jujutsu (`jj`). Use `jj status`, `jj diff`, `jj commit`, etc. - ## Build Commands ### Local Development diff --git a/flake.nix b/flake.nix index a9cde1f..1e27ebe 100644 --- a/flake.nix +++ b/flake.nix @@ -40,11 +40,6 @@ url = "github:jnsahaj/lumen"; inputs.nixpkgs.follows = "nixpkgs"; }; - jj-ryu = { - url = "github:dmmulroy/jj-ryu"; - flake = false; - }; - jj-starship.url = "github:dmmulroy/jj-starship"; nono = { url = "github:lukehinds/nono"; flake = false; diff --git a/hosts/chidi/default.nix b/hosts/chidi/default.nix index 87a3a9c..6cf7bea 100644 --- a/hosts/chidi/default.nix +++ b/hosts/chidi/default.nix @@ -31,8 +31,6 @@ ../../profiles/ghostty.nix ../../profiles/git.nix ../../profiles/home.nix - ../../profiles/jjui.nix - ../../profiles/jujutsu.nix ../../profiles/lazygit.nix ../../profiles/lumen.nix ../../profiles/mise.nix diff --git a/hosts/jason/default.nix b/hosts/jason/default.nix index 5744cd4..aefb38e 100644 --- a/hosts/jason/default.nix +++ b/hosts/jason/default.nix @@ -30,8 +30,6 @@ ../../profiles/ghostty.nix ../../profiles/git.nix ../../profiles/home.nix - ../../profiles/jjui.nix - ../../profiles/jujutsu.nix ../../profiles/lazygit.nix ../../profiles/lumen.nix ../../profiles/mise.nix diff --git a/hosts/tahani/default.nix b/hosts/tahani/default.nix index 92f0ac8..4db3aa5 100644 --- a/hosts/tahani/default.nix +++ b/hosts/tahani/default.nix @@ -31,8 +31,6 @@ ../../profiles/fzf.nix ../../profiles/git.nix ../../profiles/home.nix - ../../profiles/jjui.nix - ../../profiles/jujutsu.nix ../../profiles/lazygit.nix ../../profiles/lumen.nix ../../profiles/mise.nix diff --git a/overlays/jj-ryu.nix b/overlays/jj-ryu.nix deleted file mode 100644 index a9acba5..0000000 --- a/overlays/jj-ryu.nix +++ /dev/null @@ -1,7 +0,0 @@ -{inputs}: final: prev: { - jj-ryu = - import ../lib/build-rust-package.nix { - inherit prev; - input = inputs.jj-ryu; - }; -} diff --git a/overlays/jj-starship.nix b/overlays/jj-starship.nix deleted file mode 100644 index 3485dbf..0000000 --- a/overlays/jj-starship.nix +++ /dev/null @@ -1 +0,0 @@ -{inputs}: inputs.jj-starship.overlays.default diff --git a/profiles/aerospace.nix b/profiles/aerospace.nix index 82b5348..b0b2d4a 100644 --- a/profiles/aerospace.nix +++ b/profiles/aerospace.nix @@ -36,44 +36,44 @@ }; }; - on-window-detected = [ - { - "if" = { - "app-id" = "com.apple.systempreferences"; - }; - run = "layout floating"; - } - { - "if" = { - "app-id" = "com.mitchellh.ghostty"; - }; - run = ["layout tiling" "move-node-to-workspace 3"]; - } - { - "if" = { - "app-id" = "net.imput.helium"; - }; - run = "move-node-to-workspace 2"; - } - { - "if" = { - "app-id" = "com.tinyspeck.slackmacgap"; - }; - run = "move-node-to-workspace 5"; - } - { - "if" = { - "app-id" = "net.whatsapp.WhatsApp"; - }; - run = "move-node-to-workspace 5"; - } - { - "if" = { - "app-id" = "com.tidal.desktop"; - }; - run = "move-node-to-workspace 6"; - } - ]; + on-window-detected = [ + { + "if" = { + "app-id" = "com.apple.systempreferences"; + }; + run = "layout floating"; + } + { + "if" = { + "app-id" = "com.mitchellh.ghostty"; + }; + run = ["layout tiling" "move-node-to-workspace 3"]; + } + { + "if" = { + "app-id" = "net.imput.helium"; + }; + run = "move-node-to-workspace 2"; + } + { + "if" = { + "app-id" = "com.tinyspeck.slackmacgap"; + }; + run = "move-node-to-workspace 5"; + } + { + "if" = { + "app-id" = "net.whatsapp.WhatsApp"; + }; + run = "move-node-to-workspace 5"; + } + { + "if" = { + "app-id" = "com.tidal.desktop"; + }; + run = "move-node-to-workspace 6"; + } + ]; mode = { main.binding = { diff --git a/profiles/jjui.nix b/profiles/jjui.nix deleted file mode 100644 index 5a6277d..0000000 --- a/profiles/jjui.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - programs.jjui = { - enable = true; - }; -} diff --git a/profiles/jujutsu.nix b/profiles/jujutsu.nix deleted file mode 100644 index 14bb922..0000000 --- a/profiles/jujutsu.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ - programs.jujutsu = { - enable = true; - settings = { - user = { - name = "Christoph Schmatzler"; - email = "christoph@schmatzler.com"; - }; - git = { - sign-on-push = true; - subprocess = true; - write-change-id-header = true; - private-commits = "description(glob:'wip:*') | description(glob:'WIP:*') | description(exact:'')"; - }; - fsmonitor = { - backend = "watchman"; - }; - ui = { - default-command = "status"; - diff-formatter = ":git"; - pager = ["delta" "--pager" "less -FRX"]; - diff-editor = ["nvim" "-c" "DiffEditor $left $right $output"]; - movement = { - edit = true; - }; - }; - aliases = { - n = ["new"]; - tug = ["bookmark" "move" "--from" "closest_bookmark(@-)" "--to" "@-"]; - stack = ["log" "-r" "stack()"]; - retrunk = ["rebase" "-d" "trunk()"]; - bm = ["bookmark"]; - gf = ["git" "fetch"]; - gp = ["git" "push"]; - }; - revset-aliases = { - "closest_bookmark(to)" = "heads(::to & bookmarks())"; - "closest_pushable(to)" = "heads(::to & mutable() & ~description(exact:\"\") & (~empty() | merges()))"; - "mine()" = "author(\"christoph@schmatzler.com\")"; - "wip()" = "mine() ~ immutable()"; - "open()" = "mine() ~ ::trunk()"; - "current()" = "@:: & mutable()"; - "stack()" = "reachable(@, mutable())"; - }; - templates = { - draft_commit_description = '' - concat( - coalesce(description, default_commit_description, "\n"), - surround( - "\nJJ: This commit contains the following changes:\n", "", - indent("JJ: ", diff.stat(72)), - ), - "\nJJ: ignore-rest\n", - diff.git(), - ) - ''; - }; - }; - }; -} diff --git a/profiles/neovim/default.nix b/profiles/neovim/default.nix index 3992123..6bcf7cf 100644 --- a/profiles/neovim/default.nix +++ b/profiles/neovim/default.nix @@ -8,7 +8,6 @@ ./plugins/grug-far.nix ./plugins/harpoon.nix ./plugins/hunk.nix - ./plugins/jj-diffconflicts.nix ./plugins/lsp.nix ./plugins/mini.nix ./plugins/oil.nix diff --git a/profiles/neovim/mappings.nix b/profiles/neovim/mappings.nix index 13c84ee..2397757 100644 --- a/profiles/neovim/mappings.nix +++ b/profiles/neovim/mappings.nix @@ -118,21 +118,15 @@ options.desc = "Visit paths (cwd)"; } # g - git - { - mode = "n"; - key = "gc"; - action = ":JJDiffConflicts"; - options.desc = "Resolve conflicts"; - } { mode = "n"; key = "gg"; action.__raw = '' function() - require('toggleterm.terminal').Terminal:new({ cmd = 'jjui', direction = 'float' }):toggle() + require('toggleterm.terminal').Terminal:new({ cmd = 'lazygit', direction = 'float' }):toggle() end ''; - options.desc = "jjui"; + options.desc = "lazygit"; } # l - lsp/formatter { diff --git a/profiles/neovim/plugins/jj-diffconflicts.nix b/profiles/neovim/plugins/jj-diffconflicts.nix deleted file mode 100644 index e65c100..0000000 --- a/profiles/neovim/plugins/jj-diffconflicts.nix +++ /dev/null @@ -1,14 +0,0 @@ -{pkgs, ...}: { - programs.nixvim.extraPlugins = [ - (pkgs.vimUtils.buildVimPlugin { - name = "jj-diffconflicts"; - src = - pkgs.fetchFromGitHub { - owner = "rafikdraoui"; - repo = "jj-diffconflicts"; - rev = "main"; - hash = "sha256-hvMXpslucywVYA9Sdxx6IcXQXYcYNWK8s9jr+KtStdI="; - }; - }) - ]; -} diff --git a/profiles/opencode/skill/vcs-detect/SKILL.md b/profiles/opencode/skill/vcs-detect/SKILL.md deleted file mode 100644 index 8d770ef..0000000 --- a/profiles/opencode/skill/vcs-detect/SKILL.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -name: vcs-detect -description: Detect whether the current project uses jj (Jujutsu) or git for version control. Run this BEFORE any VCS command to use the correct tool. ---- - -# VCS Detection Skill - -Detect the version control system in use before running any VCS commands. - -## Why This Matters - -- jj (Jujutsu) and git have different CLIs and workflows -- Running `git` commands in a jj repo (or vice versa) causes errors -- Some repos use jj with git colocated (both `.jj/` and `.git/` exist) - -## Detection Logic - -Both `jj root` and `git rev-parse --show-toplevel` walk up the filesystem to find repo root. - -**Priority order:** - -1. `jj root` succeeds → jj (handles colocated too) -2. `git rev-parse` succeeds → git -3. Both fail → no VCS - -## Detection Command - -```bash -if jj root &>/dev/null; then echo "jj" -elif git rev-parse --show-toplevel &>/dev/null; then echo "git" -else echo "none" -fi -``` - -## Command Mappings - -| Operation | git | jj | -|-----------|-----|-----| -| Status | `git status` | `jj status` | -| Log | `git log` | `jj log` | -| Diff | `git diff` | `jj diff` | -| Commit | `git commit` | `jj commit` / `jj describe` | -| Branch list | `git branch` | `jj branch list` | -| New branch | `git checkout -b ` | `jj branch create ` | -| Push | `git push` | `jj git push` | -| Pull/Fetch | `git pull` / `git fetch` | `jj git fetch` | -| Rebase | `git rebase` | `jj rebase` | - -## Usage - -Before any VCS operation: - -1. Run detection command -2. Use appropriate CLI based on result -3. If `none`, warn user directory is not version controlled - -## Example Integration - -``` -User: Show me the git log -Agent: [Runs detection] -> Result: jj -Agent: [Runs `jj log` instead of `git log`] -``` - -## Colocated Repos - -When both `.jj/` and `.git/` exist, the repo is "colocated": -- jj manages the working copy -- git is available for compatibility (GitHub, etc.) -- **Always prefer jj commands** in colocated repos diff --git a/profiles/packages.nix b/profiles/packages.nix index 6264ea7..768184c 100644 --- a/profiles/packages.nix +++ b/profiles/packages.nix @@ -27,8 +27,6 @@ with pkgs; hledger htop hyperfine - jj-ryu - jj-starship jq killall lsof diff --git a/profiles/starship.nix b/profiles/starship.nix index a8180fb..25780b2 100644 --- a/profiles/starship.nix +++ b/profiles/starship.nix @@ -5,7 +5,7 @@ settings = { add_newline = true; command_timeout = 2000; - format = "[$directory$\{custom.scm}]($style)$character"; + format = "$directory$git_branch$git_status$character"; character = { error_symbol = "[✗ ](bold #e64553)"; success_symbol = "[❯](bold #40a02b)[❯](bold #df8e1d)[❯](bold #dc8a78)"; @@ -16,10 +16,26 @@ repo_root_style = "bold cyan"; repo_root_format = "[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) "; }; - custom.scm = { - when = "jj-starship detect"; - shell = ["jj-starship" "--strip-bookmark-prefix" "cschmatzler/" "--truncate-name" "20" "--bookmarks-display-limit" "1"]; - format = "$output "; + git_branch = { + format = "[$symbol$branch(:$remote_branch)]($style) "; + symbol = " "; + style = "bold #8839ef"; + truncation_length = 20; + truncation_symbol = "…"; + }; + git_status = { + format = "([$all_status$ahead_behind]($style) )"; + style = "bold #df8e1d"; + conflicted = "=$count "; + ahead = "⇡$count "; + behind = "⇣$count "; + diverged = "⇡$ahead_count⇣$behind_count "; + untracked = "?$count "; + stashed = "\\$$count "; + modified = "!$count "; + staged = "+$count "; + renamed = "»$count "; + deleted = "✘$count "; }; }; };