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

git log -Since <date> should support git.exe dates like 1week #277

Closed
ninmonkey opened this issue Jul 27, 2024 · 0 comments
Closed

git log -Since <date> should support git.exe dates like 1week #277

ninmonkey opened this issue Jul 27, 2024 · 0 comments

Comments

@ninmonkey
Copy link
Contributor

Named git dates like 1week, 3months, etc will fail when used by ugit -Since <date>
Because the strings fail coercing on parameterbinding as [datetime]

throw when used with git -Since <date>
Dates like 1week work for git.exe --since <date>

Expected Behavior: Like git.exe

> git.exe log --since 1week # 👍 works

Behavior ugit

# 👍 works
> git log -Since ( [datetime]::Now.AddDays(-7) )

# 🔴 Errors
> git log -Since 1week
Cannot process argument transformation on parameter 'After'. Cannot convert value "1week" to type "System.DateTime". Error: "The string '1week' was not recognized as a valid DateTime. There is an unknown word starting at index '1'."

Fix

I could write a PR if you know where in the docs git.exe defines valid <dates>. I did not have luck googling.
I thought maybe the datatype could stay as a [datetime] if an ArgumentTransformation first converts the strings to datetime? ( I'd have to test whether binding and transform requires the type to be [object] or not -- in pwsh )

@ninmonkey ninmonkey changed the title git log -Since <date> should support <date> values like 1week git log -Since <date> should support git.exe dates like 1week Jul 27, 2024
github-actions bot pushed a commit that referenced this issue Aug 24, 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

No branches or pull requests

1 participant