- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 934
Possible new feature (a new commit query) if not implemented yet #991
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
Comments
Having looked at it just now, I can only agree with @dongs0104 . However, as the code above calls git directly, this also means that git itself is unable to diff when the head is dangling. For this issue it means it can be closed as GitPython is probably never going to catch git command failures. |
I'm not sure if you would find it worthwhile to a function that behaves like this:
This obviously still uses try/except, but it could be a useful wrapper. You could then run things like
I know this would be useful for me because it would feel more natural in the code, and if it's included in the repo object, I would be able to reduce the number of imports needed in my code |
I wouldn't mind seeing a PR for this. The method would probably be called |
When executing the following:
it raises an exception when there are no previous commits. It could be a nice feature to have a kind of query that checks if the wanted commit exists (before executing instructions as reported).
I know it is possible to use a
try
andexception
(and it is what I do in my code at line 99). However, I think it is still a nice feature to have.I am writing this issue following the suggestion of @Byron in this closed issue.
Besides, if there are suggestions or advice to implement a script (using your API) for analyzing your own git repo and reporting the info in a meaningful way, please do not hesitate to write it down here. I am trying to implement it (for fun) in this little project.
The text was updated successfully, but these errors were encountered: