Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Negative Values for days_after Parameter in Contribution Script #35

Closed

Conversation

jasonuc
Copy link

@jasonuc jasonuc commented Jan 11, 2024

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_after to ensure the sum of days_before and days_after is 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 = 30
  • days_after = 10
    This 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 = 30
  • days_after = -5
    This 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

@jeremiah-shore
Copy link

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 😛

@jasonuc jasonuc closed this May 22, 2024
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.

None yet

2 participants