Skip to content

Permit git cat-file in pre-commit shim - #33

Merged
dirk merged 1 commit into
dirk:mainfrom
saveman71:permit-git-cat-file
Jul 26, 2026
Merged

Permit git cat-file in pre-commit shim#33
dirk merged 1 commit into
dirk:mainfrom
saveman71:permit-git-cat-file

Conversation

@saveman71

@saveman71 saveman71 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Ran into this with a pre-commit hook that compares the HEAD and staged versions of the files being committed. It reads the blobs with git cat-file --batch, which the shim currently rejects (git is not allowed in parallel hooks (git cat-file --batch)).

cat-file is read-only, same family as the commands allowed in #21 and #24.

@saveman71

saveman71 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

While working on this I noticed a few more subcommands that are always read-only and could join the list:

  • diff-index
  • diff-tree
  • diff-files
  • ls-tree
  • merge-base
  • check-ignore
  • check-attr
  • log

I only need cat-file myself so I kept the PR to that, but happy to add some or all of these here if you'd rather batch them.

@dirk
dirk merged commit 3c1cf44 into dirk:main Jul 26, 2026
5 checks passed
@dirk

dirk commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Thanks! 💖 Will cut a new release shortly. Opened #34 to track the others.

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

Successfully merging this pull request may close these issues.

2 participants