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

Add end_date_before arg to the script #22

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

gharghi
Copy link

@gharghi gharghi commented Nov 8, 2022

Add feature to specify the finish date before current dats. For example run script from 50 days to 10 days before current date.

@Shpota
Copy link
Owner

Shpota commented Nov 9, 2022

Hey @gharghi
Thank you for opening the PR. I think --end_days_before might be too complicated for an end user to understand. For the scenario that you are implementing, it would be more convenient to just have the start_date and end_date properties

@gharghi
Copy link
Author

gharghi commented Nov 9, 2022

Your comment makes sense.
I have added start_date and end_date

@@ -58,7 +58,16 @@ will keep committing.
```sh
python contribute.py --days_before=10 --days_after=15
```
Use `--start_date` to specify start date of commits. This option doesn't work if used with days_before.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would propose making them mutually exclusive. If one of them is specified, the script should work. If both are specified, it should show an error.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't.
Imagine you need to set a period of time in last year.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, if someone uses both --days_before and --start_date this should lead to an error

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be. But I thought to make it more error free and handle them in the code.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better when the logic is explicit and the user doesn't have to guess what would happen when they specify two parameters that collide

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