Read output log without mutating the output repository - #124
Merged
Conversation
Reading the run history used to hard-reset the output repository and check out its main branch, so merely enumerating candidate result branches could discard uncommitted work. The log is now read from the main branch ref instead. Matching a case that declares no environment no longer loads the recorded environment either, since run_history only exists on the main branch and the comparison was a no-op regardless.
schmoelder
added a commit
that referenced
this pull request
Aug 13, 2026
Reading the run history used to hard-reset the output repository and check out its main branch, so merely enumerating candidate result branches could discard uncommitted work. The log is now read from the main branch ref instead. Matching a case that declares no environment no longer loads the recorded environment either, since run_history only exists on the main branch and the comparison was a no-op regardless.
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.
OutputRepo.output_log used to read the run history by resetting the output repository and checking out its main branch. That made a read operation change local Git state, and in the worst case it could discard uncommitted work in the output repository.
This PR changes log reading to read log.tsv directly from the local main ref. Reading the output log no longer checks out main, resets the working tree, updates refs, fetches, pulls, or pushes. The write path remains separate: update_output_main_logs() still intentionally checks out output main, updates log.tsv and run_history, commits them, and returns to the result branch.
The tests cover that reading the log leaves the output repository on the same branch, preserves uncommitted files, still lists recorded result branches, and works for a fresh repository without a log.
This is not intended as a breaking change. It removes an unintended side effect from a read property. Code that accidentally relied on output_repo.output_log also cleaning the output repository or switching it to main would behave differently, but that behavior was the bug.