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
F14058682: D15293.diff
Sun, Nov 17, 1:49 PM
F13991417: D15293.id.diff
Tue, Oct 22, 10:42 AM
F13982764: D15293.id36894.diff
Sun, Oct 20, 1:50 AM
F13968104: D15293.diff
Oct 16 2024, 6:38 PM
Unknown Object (File)
Oct 10 2024, 2:20 AM
Unknown Object (File)
Oct 3 2024, 12:48 AM
Unknown Object (File)
Oct 1 2024, 4:16 PM
Unknown Object (File)
Sep 4 2024, 10:57 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.