Skip to content

Conversation

@ptarjan
Copy link

@ptarjan ptarjan commented Dec 26, 2025

fixes #3604

https://git-scm.com/docs/git-cat-file

-e
Exit with zero status if <object> exists and is a valid object. If <object> is of an invalid format, exit with non-zero status and emit an error on stderr.

Copy link
Member

@asottile asottile left a 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

@ptarjan
Copy link
Author

ptarjan commented Dec 26, 2025

How is that different than the current implementation?

~/github/pre-commit rev-list $ git rev-list --quiet abcde --
fatal: bad revision 'abcde'
~/github/pre-commit rev-list $ git cat-file -e abcde
fatal: Not a valid object name abcde

@ptarjan ptarjan requested a review from asottile December 26, 2025 22:11
@ptarjan
Copy link
Author

ptarjan commented Dec 26, 2025 via email

@asottile
Copy link
Member

do you actually understand what not 0 does? I'm more and more convinced you're just regurgitating llm nonsense and wasting my time. a human would have just changed the command and called it a day but instead we're somehow 10 commits deep

@asottile
Copy link
Member

How is that different than the current implementation?

~/github/pre-commit rev-list $ git rev-list --quiet abcde --
fatal: bad revision 'abcde'
~/github/pre-commit rev-list $ git cat-file -e abcde
fatal: Not a valid object name abcde

You're absolutely right!

@ptarjan ptarjan requested a review from asottile December 27, 2025 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

git rev-list --quiet is slow in a large repo

2 participants