From: Anderson A. Giacomolli Date: Fri, 6 Nov 2026 14:26:51 +0000 (-0300) Subject: Keep development data in .devenv X-Git-Url: http://git.giacomolli.uk/onechat/commitdiff_plain/6572373d4945cc5c504fc5f760d7de51fb245d3f?ds=inline Keep development data in .devenv 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. --- diff --git a/.gitignore b/.gitignore index ba4f6ff..92f30ce 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /result* /onechat /AGENTS.local.md +/.devenv/ diff --git a/README.rst b/README.rst index ce4696e..df03c4f 100644 --- a/README.rst +++ b/README.rst @@ -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 diff --git a/nix/devshell.nix b/nix/devshell.nix index fdf65e9..110a7c4 100644 --- a/nix/devshell.nix +++ b/nix/devshell.nix @@ -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 ''; }