-
Notifications
You must be signed in to change notification settings - Fork 94
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
[CLI] Use Git Human-readable date syntax for --lookback analyze flag #4993
Comments
(Sorry this didn't follow the format. I followed a link that circumvented the template splash screen it seems!) |
The current logic leverages We could potentially use something like https://github.com/markusmobius/go-dateparser/tree/main instead to parse relative dates like git… But I think it would be harder trying to replicate the exact date format from Git 🤔 |
I think the gist of my proposal is those flags can just be 100% pass throughs to Git. More functionality with even less code. (Probably don't even need to mess with passing through |
I see your point. It should be possible for us to support an alternative pair of flags: The downside is the errors from git could be cryptic to users 🤔 @bduffany WDYT? |
Passing the values straight through to git would prevent us e.g. from failing fast if the values are invalid, and also makes the code less portable/flexible since now we're using a git interface as opposed to a more standard go interface (time.Duration). I think it'd be fine to be more lenient in what we accept for that flag value though, e.g. use a little regex like I also like the separate |
The analyze command converts a what looks to be some kind of Go primitive(?)
Whether my interpretation is right or wrong, since it clearly is meant to be used on Git history I'd recommend using Human-readable date syntax directly in place of a date string in
--since
and allowing users to pass those strings directly.i.e.
Similar to:
The text was updated successfully, but these errors were encountered: