-
-
Notifications
You must be signed in to change notification settings - Fork 910
use git cat-file -e instead of git rev-list in _rev_exists #3605
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this causes output spew on missing / invalid revisions
|
How is that different than the current implementation? |
This reverts commit 5a4235c.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
I mean I liked the == 0 since the docs explicitly talk about retuning 0
when the SHA exists but this is your project and I just want the
functionality. I’ll switch back to not
…On Fri, Dec 26, 2025 at 12:41 PM anthony sottile ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pre_commit/commands/hook_impl.py
<#3605 (comment)>
:
> - return not subprocess.call(('git', 'rev-list', '--quiet', rev))
+ return not bool(
+ subprocess.call(
+ ('git', 'cat-file', '-e', rev),
+ stderr=subprocess.DEVNULL,
+ ),
+ )
not bool(...) is the same as not ... which you'll notice is *exactly what
the original code does*
—
Reply to this email directly, view it on GitHub
<#3605 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAJZT6M52IG7ENARCRZII34DW2QTAVCNFSM6AAAAACQCVVVUOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTMMJTHEZTAOBQHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
do you actually understand what |
You're absolutely right! |
fixes #3604
https://git-scm.com/docs/git-cat-file