Skip to content

Fix early exit with stop-at-end when commits remain in queue#365

Open
enmaku wants to merge 1 commit into
acaudwell:masterfrom
enmaku:fix/stop-at-end-gap-autoskip
Open

Fix early exit with stop-at-end when commits remain in queue#365
enmaku wants to merge 1 commit into
acaudwell:masterfrom
enmaku:fix/stop-at-end-gap-autoskip

Conversation

@enmaku

@enmaku enmaku commented Jun 30, 2026

Copy link
Copy Markdown

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 that stop_at_end still waits for commitqueue to drain, and auto-skip remains enabled while queued commits are waiting.

Problem

-o (and --stop-at-end) enable stop_at_end unless --dont-stop, --loop, or reading from stdin (-) is used (gource_shell.cpp).

In readLog(), once the commit log reaches EOF (commitlog->isFinished()), stop_position_reached is set immediately — even though commits with later timestamps may already be sitting in commitqueue waiting for simulation time to catch up.

Two consequences:

  1. Auto-skip is disabled once stop_position_reached is true (logic(), ~line 1749), so Gource no longer jumps across idle gaps while those queued commits are pending.
  2. Exit does not check the queueupdateUsers() sets appFinished when users.empty() && stop_position_reached (~line 1401), without requiring commitqueue.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

  1. Exit guard — only finish when the queue is drained:

    if(users.empty() && stop_position_reached && commitqueue.empty())
  2. 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

  • Repo with a multi-day commit gap and activity after the gap: render with -o and confirm the final commits and clock date are shown
  • Same repo without -o / --stop-at-end — behaviour unchanged
  • --dont-stop and --loop paths unchanged
  • Short history with no gaps — still exits cleanly at end
  • --stop-date / --stop-position stopping before EOF — still stops at the requested point

Verified 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.

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.
@enmaku enmaku marked this pull request as ready for review June 30, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant