use git cat-file -e instead of git rev-list in _rev_exists#3605
use git cat-file -e instead of git rev-list in _rev_exists#3605ptarjan wants to merge 11 commits into
Conversation
|
How is that different than the current implementation? |
Sorry, something went wrong.
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:
***@***.***>
|
Sorry, something went wrong.
|
do you actually understand what |
Sorry, something went wrong.
You're absolutely right! |
Sorry, something went wrong.
|
Is there anything else on this PR you need from me? |
Sorry, something went wrong.
Would you prefer anything else from me to get this merged? |
Sorry, something went wrong.
Sorry, something went wrong.
|
@asottile didn't want a PR generated by Claude to be included in his repo so I generated this one by hand |
Sorry, something went wrong.
fixes #3604
https://git-scm.com/docs/git-cat-file