Fix early exit with stop-at-end when commits remain in queue#365
Open
enmaku wants to merge 1 commit into
Open
Conversation
When rendering to video (-o), Gource enables stop_at_end and sets stop_position_reached as soon as the log EOF is read, before the simulation drains commitqueue. Auto-skip is then disabled and the app can exit mid-gap while later commits are still unprocessed. Keep auto-skip active while the queue is non-empty and defer exit until users are gone and the queue has been drained.
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
When rendering to video (
-o), Gource can stop the simulation before the final commits are processed if there is a long idle gap in the repository history.This changes two guards in
Gource::logic()/Gource::updateUsers()so thatstop_at_endstill waits forcommitqueueto drain, and auto-skip remains enabled while queued commits are waiting.Problem
-o(and--stop-at-end) enablestop_at_endunless--dont-stop,--loop, or reading from stdin (-) is used (gource_shell.cpp).In
readLog(), once the commit log reaches EOF (commitlog->isFinished()),stop_position_reachedis set immediately — even though commits with later timestamps may already be sitting incommitqueuewaiting for simulation time to catch up.Two consequences:
stop_position_reachedis true (logic(), ~line 1749), so Gource no longer jumps across idle gaps while those queued commits are pending.updateUsers()setsappFinishedwhenusers.empty() && stop_position_reached(~line 1401), without requiringcommitqueue.empty().On a repo with a multi-day gap followed by a burst of commits (e.g. last activity on 24 June, next commit on 30 June), the visualization can exit around the gap while the final commits never appear. The on-screen clock reflects the last processed time, not the last commit in the log.
Reproduced with stock Gource 0.56 on a real git repo:
gource --start-date '2026-06-20' --stop-date '2026-07-01' -1280x720 -o - <repo>— last frame showed ~26 June; the 30 June commits were never rendered.Fix
Exit guard — only finish when the queue is drained:
if(users.empty() && stop_position_reached && commitqueue.empty())Auto-skip guard — keep skipping idle time while commits remain queued after EOF:
if(... && (!stop_position_reached || !commitqueue.empty()))No changes to log parsing, timestamp handling, or CLI flags.
Test plan
-oand confirm the final commits and clock date are shown-o/--stop-at-end— behaviour unchanged--dont-stopand--looppaths unchanged--stop-date/--stop-positionstopping before EOF — still stops at the requested pointVerified locally on macOS (arm64) against a git repo with a ~5.7-day gap (24 Jun → 30 Jun): stock build stopped ~26 Jun; patched build reached 30 Jun and exited on its own.