Commit Graph
15 Commits
Author SHA1 Message Date
mathias e97205c4bf Hide changed connection lines behind -v/--verbose
set_local_db/set_dot_env diffs can contain secrets (connection
strings), so printing them unconditionally on every up/down leaked
credentials to stdout. Default output is now a line-count summary;
pass -v/--verbose to see the actual before/after lines.
2026-09-18 17:59:55 +02:00
mathias 6b6c031242 Restore connections.env without triggering post-checkout hooks
git checkout fires post-checkout even for a single-file checkout
(flag=0), which was tripping an rsync hook in the target repo. Read
the committed blob with git cat-file instead and write it directly -
plumbing, no worktree update, no hooks - with a test that plants a
post-checkout hook and asserts it never runs.
2026-09-17 16:07:48 +02:00
mathias 9f4a0dc446 Preserve trailing newlines and restore connections.env via git checkout on down
Fix set_local_db/set_dot_env unconditionally stripping (then forcing)
the file's trailing newline: they now detect whether the source file
originally ended in a newline and reproduce that on write, verified
against both the newline and no-newline cases.

Replace the reverse-toggle computation for connections.env on `down`
with a straight `git checkout`, so the file always ends up
byte-for-byte identical to HEAD instead of relying on toggle logic to
get it exactly right. Both git call sites now go through a shared
helper that checks the process exit status and errors out instead of
silently reporting success on a failed checkout/update-index, with
test coverage against real temporary git repos.
2026-09-17 15:44:14 +02:00
mathias 3873987c19 Always update connections.env and fix double-toggled connection line
Drop the --legacy flag: set_local_db and toggle_index now run
unconditionally instead of only when -l was passed, since that was the
flag's only effect.

Fix set_dot_env writing the connection/RCC_CONNECTION line twice with
opposing polarity (once from the #docker pass, once from the #cidb
pass), which flipped it to the wrong value. Collapsed the three
separate open/read/write passes into one, toggling both sections and
the connection line in a single scan so the connection line is only
ever touched once.
2026-09-17 15:12:32 +02:00
mathias 36752606a6 stop git-checkout from reverting connections.env on down
toggle_index ran git checkout on connections.env whenever going
down, discarding whatever set_local_db had just written and
restoring whatever format happens to be committed. This silently
undid the RCC_/legacy dual-format toggle. update-index still marks
the file assume-unchanged/no-assume-unchanged; the checkout is gone.
2026-09-17 11:33:49 +02:00
mathias 72e0c229f3 report which lines changed on up/down
set_local_db, toggle_after_line and set_dot_env now return a
FileChange (path + before/after line pairs) instead of (), and main
prints it after each toggle so 'up'/'down' shows exactly what the
program rewrote in each env file.
2026-09-17 11:00:17 +02:00
mathias 12b8701e00 support RCC_-prefixed env keys alongside legacy dotted keys
connections.env and local .env are transitioning from dotted keys
(ci.db.master.ip, connection) to upper-cased RCC_-prefixed keys
(RCC_CI_DB_MASTER_IP, RCC_CONNECTION). Both forms are matched and
toggled during the migration, so old branches keep working while
new ones use the new format.
2026-09-17 10:43:13 +02:00
mathias 481e3a1dcc implemented proper error handling, added README 2026-06-26 12:30:19 +02:00
mathias 649c08ad4b remove reference 2025-03-14 10:55:13 +01:00
mathias 5044f6a19c added git update index 2024-01-27 19:11:16 +01:00
mathias 1993aca4f2 added set dot env 2024-01-22 19:30:27 +01:00
mathias 708ae57d1f Added Parser 2024-01-21 18:45:34 +01:00
mathias 114a1accde Added Arguments 2024-01-21 12:37:43 +01:00
mathias 4ef959f673 Docker start/stop 2024-01-20 18:21:25 +01:00
mathias 93be1c8352 initial commit 2024-01-20 12:01:41 +01:00