Page MenuHomePhabricator

Install pre-commit hooks in Git repositories
ClosedPublic

Authored by epriestley on Dec 2 2013, 9:46 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 29, 5:31 PM
Unknown Object (File)
May 25 2025, 8:00 PM
Unknown Object (File)
May 25 2025, 7:18 PM
Unknown Object (File)
May 9 2025, 1:29 PM
Unknown Object (File)
May 9 2025, 9:42 AM
Unknown Object (File)
May 6 2025, 3:33 AM
Unknown Object (File)
May 5 2025, 8:17 PM
Unknown Object (File)
Apr 29 2025, 3:53 AM
Subscribers

Details

Summary

Ref T4189. T4189 describes most of the intent here:

  • When updating hosted repositories, sync a pre-commit hook into them instead of doing a git fetch.
  • The hook calls into Phabricator. The acting Phabricator user is sent via PHABRICATOR_USER in the environment. The active repository is sent via CLI.
  • The hook doesn't do anything useful yet; it just veifies basic parameters, does a little parsing, and exits 0 to allow the commit.
Test Plan
  • Performed Git pushes and pulls over SSH and HTTP.

Diff Detail

Branch
hooks
Lint
Lint Passed
SeverityLocationCodeMessage
Advicesrc/applications/diffusion/engine/DiffusionCommitHookEngine.php:52XHP16TODO Comment
Unit
Tests Passed

Event Timeline

Cool. Excited to see how the 3rd party hook stuff ends up working (see T4189)

src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
310

are we implicitly in the.git folder in this case or?

src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
310

Yeah, in the bare case the top level folder is basically the same as ".git/".