github-activity-generator
github-activity-generator copied to clipboard
Support Negative Values for days_after Parameter in Contribution Script
Overview
This introduces the ability to use negative values for the days_after parameter in the GitHub contribution generation script. This enhancement increases the flexibility of the script, allowing users to specify a commit history that ends before the current date.
Changes
- Modified the error check for
days_afterto ensure the sum ofdays_beforeanddays_afteris non-negative. - Adjusted the commit generation loop to correctly handle negative values for
days_after, enabling the script to create a commit history that can end before the current date.
Impact
This change allows users to have more control over the date range for commit generation. It is particularly useful for scenarios where the user wants to backdate contributions but stop at a certain point before the current date.
Examples
Example 1: Standard Usage
days_before = 30days_after = 10This would generate commits from 30 days before the current date to 10 days after the current date.
Example 2: Using Negative days_after
days_before = 30days_after = -5This would generate commits from 30 days before the current date and stop 5 days before the current date. It's particularly useful for creating a commit history that doesn't include the most recent days.
Credit to @jeremiah-shore who gave me this idea from a suggestion
Also glad for the reminder that this project exists. I literally landed the largest branch I've ever worked on yesterday... 430 commits. BUT, since we squashed it, there's no pretty green tile mosaic 😛