Repository navigation
Read logs.dir from the User config to set where session logs go - #117
Merged
Merged
Conversation
A leading ~ expands to $HOME; a relative path stops the Run before any work, naming the setting. Without it, logs stay in ~/.thirdshift/logs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UserConfig now holds the logs directory itself, defaulting under the same HOME it read the file from, and Logs carries the issue its paths are named for. A bare ~ is documented as accepted, and the relative logs.dir test checks the exact error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JacobStephens2
added a commit
that referenced
this pull request
Sep 29, 2026
Combines main's logs.dir setting (#117) with this branch's [email] section: the User config now knows the merge, logs and email sections, holds both the resolved logs directory and the email settings, and the README and help text document both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A
[logs] dirsetting in the User config sets where session logs go. It is resolved once, when the config loads, and a Run logs there.The README and
helpdocumentlogs.dir.~on its own,~/…and absolute paths are accepted. Relative paths,~other/…and""are rejected, with an error naminglogs.dirand the config file.Evidence
tests/user_config.rsfailed:[logs]was an unknown section, and~/elsewhere/logsand absolute dirs were never written to.After: these tests pass:
without_logs_dir_session_logs_go_to_the_default_directory,a_logs_dir_under_tilde_is_under_home_and_created_if_missing,an_absolute_logs_dir_is_used_as_is(each checks that the Failed run'ssession log:line points into the directory) anda_relative_or_mistyped_logs_dir_stops_the_run_naming_the_setting(checked withassert_rejected_before_any_work). The fullcargo testrun passes andcargo clippy --all-targetsis clean.Merge Danger
Door: two-way
Blast Radius: small
Existing configs behave as before, and the default logs location is unchanged. One behaviour change: a Run with
HOMEunset or empty now stops before any work withHOME is not set. Before, it got past preflight and then failed at the first log path.Unaddressed findings
Standards
matches!(…"merge" | "logs")and the key match arms. Skipped because the first check exists to give its own errors ("unknown section" vs "must be the section [logs]"). With two sections, merging the checks would make the code harder to read.implementtakes both&Logsand&mut PathBuf log. Skipped because this pattern predates the change (it used to betimestamp).logis the most recent session's log for the Failed run path, not part of where logs go.Spec
helpnow documentslogs.dir. Kept, to match howhelpalready documentsmerge.always.~is accepted. Kept and documented in the README and the error message, because~is$HOME, an absolute path.HOMEnow stops the Run inmainbefore any work. Kept because the logs directory is resolved when the config loads, and failing before any work is better than failing later with a worktree already created.Closes #112
🤖 Generated with Claude Code