Add --output-start-date and --output-stop-date for segment rendering #353
+97
−1
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
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 dateKey Difference from Existing Options
The existing
--start-dateand--stop-dateoptions filter log entries (commits), which means:--start-datewon't appearThe new
--output-start-dateand--output-stop-dateoptions simulate the full history but only output frames within the specified range: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):
With this PR (efficient segment rendering):
Each segment shows the repository in its correct state, and segments can be concatenated into a seamless video.
Implementation
Files Modified
src/gource_settings.h- Added new member variables:output_start_timestamp,output_stop_timestamp(time_t)output_start_date,output_stop_date(std::string)src/gource_settings.cpp- Added:parseDateTimefunction)src/gource.cpp- Modifiedupdate()to check date range beforeframeExporter->dump():output_start_timestampoutput_stop_timestampand setstop_position_reachedREADME.md- Added documentation for both new optionsDesign Decisions
--start-date/--stop-datestop_position_reachedflag when passingoutput_stop_dateto properly exit when using--stop-at-endTesting
Tested locally on macOS with a sample repository:
Successfully produced a video showing only October 2011 activity with the full repository tree structure intact.