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)
Mon, Feb 3, 9:09 AM
Unknown Object (File)
Wed, Jan 29, 12:49 AM
Unknown Object (File)
Mon, Jan 27, 12:03 AM
Unknown Object (File)
Sun, Jan 26, 7:34 PM
Unknown Object (File)
Thu, Jan 23, 11:36 AM
Unknown Object (File)
Tue, Jan 21, 1:56 PM
Unknown Object (File)
Tue, Jan 21, 11:41 AM
Unknown Object (File)
Sat, Jan 18, 7:32 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

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