Page MenuHomePhabricator

Install pre-commit hooks in Git repositories
ClosedPublic

Authored by epriestley on Dec 2 2013, 9:46 PM.
Tags
None
Referenced Files
F13159641: D7682.diff
Mon, May 6, 2:21 AM
Unknown Object (File)
Wed, May 1, 8:05 PM
Unknown Object (File)
Sun, Apr 28, 10:59 PM
Unknown Object (File)
Sun, Apr 28, 10:59 PM
Unknown Object (File)
Sun, Apr 28, 9:27 AM
Unknown Object (File)
Sat, Apr 27, 1:33 PM
Unknown Object (File)
Sat, Apr 20, 6:08 PM
Unknown Object (File)
Wed, Apr 17, 3:08 PM
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

Lint
Lint Skipped
Unit
Tests Skipped

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/".