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
F15431063: D15293.id36895.diff
Mon, Mar 24, 10:18 AM
F15408866: D15293.id36894.diff
Wed, Mar 19, 2:01 AM
F15395783: D15293.id36896.diff
Sun, Mar 16, 9:48 AM
F15388989: D15293.id.diff
Sat, Mar 15, 4:47 AM
F15386505: D15293.id36894.diff
Sat, Mar 15, 12:44 AM
F15364335: D15293.id36894.diff
Tue, Mar 11, 1:20 PM
Unknown Object (File)
Feb 24 2025, 5:59 AM
Unknown Object (File)
Feb 22 2025, 5:28 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.