Page MenuHomePhabricator

Remove dependence on callsigns from `bin/commit-hook`
ClosedPublic

Authored by epriestley on Feb 18 2016, 12:46 AM.
Tags
None
Referenced Files
F18934011: D15293.id36894.diff
Mon, Nov 10, 12:58 PM
F18934010: D15293.id36895.diff
Mon, Nov 10, 12:58 PM
F18878194: D15293.diff
Thu, Nov 6, 3:45 PM
F18846079: D15293.id36896.diff
Wed, Oct 29, 4:30 PM
F18778750: D15293.id.diff
Oct 11 2025, 10:41 AM
F18766201: D15293.id.diff
Oct 7 2025, 3:30 PM
F18763902: D15293.diff
Oct 7 2025, 3:00 AM
F18753348: D15293.id36895.diff
Oct 4 2025, 6:25 PM
Subscribers
None

Details

Summary

Ref T4245. Two effects:

  • First, let hooks work for future repositories without callsigns.
  • Second, provide a better error when users push directly to hosted repositories.
Test Plan

Ran bin/commit-hook PHID-REPO-xxx.

Diff Detail

Repository
rP Phabricator
Branch
call1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 10737
Build 13207: Run Core Tests
Build 13206: arc lint + arc unit

Event Timeline

epriestley retitled this revision from to Remove dependence on callsigns from `bin/commit-hook`.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
avivey added a reviewer: avivey.
This revision is now accepted and ready to land.Feb 18 2016, 12:48 AM
epriestley edited edge metadata.
  • Oh, don't actually need that extra parameter to pht() for the error anymore.
  • Oh, don't actually need that extra parameter to pht() for the error anymore.

Isn't there a lint for that?

This revision was automatically updated to reflect the committed changes.

I think lint only warns you about too few arguments right now for some arcane but nontrivial-to-resolve technical reason that I don't recall offhand.

Oh, it's that we don't actually have a sprintf parser and just print the string and catch exceptions to see if it's valid:

try {
  xsprintf(null, null, $argv);
} catch (BadFunctionCallException $ex) {
  $this->raiseLintAtNode(
    $call,
    str_replace('xsprintf', $name, $ex->getMessage()));
} catch (InvalidArgumentException $ex) {
  // Ignore.
}

I think lint only warns you about too few arguments right now for some arcane but nontrivial-to-resolve technical reason that I don't recall offhand.

Oh, it's that we don't actually have a sprintf parser and just print the string and catch exceptions to see if it's valid:

try {
  xsprintf(null, null, $argv);
} catch (BadFunctionCallException $ex) {
  $this->raiseLintAtNode(
    $call,
    str_replace('xsprintf', $name, $ex->getMessage()));
} catch (InvalidArgumentException $ex) {
  // Ignore.
}

That is a pretty awesome reason, in a facebook-sort-of-way :P

Yeah, it's kinda awful but kinda clever.