]> git.giacomolli.uk - onechat/commitdiff
Keep development data in .devenv
authorAnderson A. Giacomolli <agiacomolli@gmail.com>
Fri, 6 Nov 2026 14:26:51 +0000 (11:26 -0300)
committerAnderson A. Giacomolli <agiacomolli@gmail.com>
Fri, 6 Nov 2026 14:26:51 +0000 (11:26 -0300)
The development shell sets ONECHAT_DIR to .devenv/onechat at the root of
the checkout, unless the variable is already set. Development data, such
as a copy of an old chat log for a replay, stays inside the checkout,
away from a running service, and Git ignores it. Each worktree has its
own .devenv, so parallel work does not share data.

.gitignore
README.rst
nix/devshell.nix

index ba4f6ffbcba2f36ebf51f7fdcb80671405224206..92f30ce9eb0356ade1ce4b99db6702112baa1120 100644 (file)
@@ -2,3 +2,4 @@
 /result*
 /onechat
 /AGENTS.local.md
+/.devenv/
index ce4696ef0a650b6bf67f182e8fadf8c742710d33..df03c4f647b5575ada6afa6b73fe133490eef73d 100644 (file)
@@ -22,6 +22,10 @@ Or enter it directly:
 
    nix develop
 
+The shell sets ``ONECHAT_DIR`` to ``.devenv/onechat`` in the checkout,
+unless it is already set. Development data goes there, and Git ignores
+``.devenv``.
+
 Build and run:
 
 .. code:: console
index fdf65e96921cf546d418db10aea78cba0017f46d..110a7c490a43988bb39964bc7818be970dfc4a2e 100644 (file)
@@ -22,5 +22,8 @@ pkgs.mkShell {
 
   shellHook = ''
     git config core.hooksPath .githooks 2>/dev/null || true
+    root=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
+    export ONECHAT_DIR="''${ONECHAT_DIR:-$root/.devenv/onechat}"
+    unset root
   '';
 }