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
Unknown Object (File)
Fri, Feb 14, 4:14 AM
Unknown Object (File)
Sun, Feb 9, 12:47 AM
Unknown Object (File)
Sun, Feb 9, 12:47 AM
Unknown Object (File)
Sun, Feb 9, 12:47 AM
Unknown Object (File)
Tue, Feb 4, 11:07 AM
Unknown Object (File)
Thu, Jan 30, 8:24 AM
Unknown Object (File)
Sat, Jan 25, 10:25 AM
Unknown Object (File)
Sat, Jan 25, 1:01 AM
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.