Skip to content

Conversation

@ktamas77
Copy link

@ktamas77 ktamas77 commented Dec 26, 2025

Summary

This PR adds two new command-line options that enable segment rendering - the ability to render only a specific date range while still simulating the full repository history.

New Options

  • --output-start-date "YYYY-MM-DD hh:mm:ss +tz" - Start outputting frames from this date
  • --output-stop-date "YYYY-MM-DD hh:mm:ss +tz" - Stop outputting frames after this date

Key Difference from Existing Options

The existing --start-date and --stop-date options filter log entries (commits), which means:

  • Files that existed before --start-date won't appear
  • The visualization starts from scratch at the specified date

The new --output-start-date and --output-stop-date options simulate the full history but only output frames within the specified range:

  • All files and contributors are in their correct positions
  • The tree structure reflects the complete repository state at that point in time
  • Only the rendering output is filtered, not the simulation

Motivation / Use Case

When rendering visualizations for large repositories with years of history, it's often desirable to produce weekly or monthly video segments rather than one massive video.

Current approach (inefficient):

# Render January - processes ALL history, outputs ALL frames
gource --start-date "2024-01-01" --stop-date "2024-01-31" -o jan.ppm

# Render February - starts from scratch, files missing
gource --start-date "2024-02-01" --stop-date "2024-02-28" -o feb.ppm

With this PR (efficient segment rendering):

# Render January segment - full history simulated, only Jan frames output
gource --output-start-date "2024-01-01" --output-stop-date "2024-01-31" -o jan.ppm

# Render February segment - full history simulated, only Feb frames output  
gource --output-start-date "2024-02-01" --output-stop-date "2024-02-28" -o feb.ppm

Each segment shows the repository in its correct state, and segments can be concatenated into a seamless video.

Implementation

Files Modified

  1. src/gource_settings.h - Added new member variables:

    • output_start_timestamp, output_stop_timestamp (time_t)
    • output_start_date, output_stop_date (std::string)
  2. src/gource_settings.cpp - Added:

    • Argument type definitions
    • Default value initialization
    • Parameter parsing (reusing existing parseDateTime function)
    • Help text
  3. src/gource.cpp - Modified update() to check date range before frameExporter->dump():

    • Skip frames before output_start_timestamp
    • Skip frames after output_stop_timestamp and set stop_position_reached
  4. README.md - Added documentation for both new options

Design Decisions

  • Follows the same date parsing format as existing --start-date/--stop-date
  • Uses stop_position_reached flag when passing output_stop_date to properly exit when using --stop-at-end
  • Minimal code changes - reuses existing infrastructure
  • Backward compatible - no changes to existing behavior

Testing

Tested locally on macOS with a sample repository:

./gource . --output-start-date "2011-10-01" --output-stop-date "2011-10-31" \
  --output-framerate 60 --seconds-per-day 0.1 --stop-at-end -o - | \
  ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 output.mp4

Successfully produced a video showing only October 2011 activity with the full repository tree structure intact.

ktamas77 and others added 2 commits December 26, 2025 00:59
These new parameters control frame output timing while still simulating
the full repository history. Unlike --start-date/--stop-date which filter
log entries, these options:

- --output-start-date: Start outputting frames from this date
- --output-stop-date: Stop outputting frames after this date

Key behavior:
- Gource simulates the full history internally (files/avatars positioned correctly)
- Only outputs frames within the specified date range
- Useful for rendering segments of long repository histories efficiently

This enables rendering weekly/monthly video segments without processing
the entire history multiple times.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document the new segment rendering options in README.md.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cett
Copy link

cett commented Dec 29, 2025

Köszönöm, ez nagyon hasznos commit nem is értem eddig miért nem jutott senkinek eszébe!

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.

2 participants