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
F18475924: D15293.diff
Wed, Sep 3, 12:02 AM
F18453439: D15293.id36895.diff
Mon, Sep 1, 4:17 AM
F18453023: D15293.id36896.diff
Mon, Sep 1, 3:04 AM
F18448608: D15293.diff
Sun, Aug 31, 11:31 PM
F18195301: D15293.id.diff
Aug 17 2025, 3:04 PM
F18195049: D15293.id36894.diff
Aug 17 2025, 1:35 PM
F18193989: D15293.id36895.diff
Aug 17 2025, 7:52 AM
F18185021: D15293.diff
Aug 16 2025, 2:51 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
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.