Page MenuHomePhorge

Config: Fix git errors when .git does not exist
ClosedPublic

Authored by xtex on Fri, Mar 28, 14:55.
Tags
None
Referenced Files
F3336385: D25931.1743573288.diff
Tue, Apr 1, 05:54
F3334694: D25931.1743552984.diff
Tue, Apr 1, 00:16
F3331722: D25931.1743511469.diff
Mon, Mar 31, 12:44
F3330650: D25931.1743492241.diff
Mon, Mar 31, 07:24
F3330533: D25931.1743490636.diff
Mon, Mar 31, 06:57
F3328348: D25931.1743454760.diff
Sun, Mar 30, 20:59
F3321681: D25931.1743358815.diff
Sat, Mar 29, 18:20
F3321670: D25931.1743358340.diff
Sat, Mar 29, 18:12

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

xtex requested review of this revision.Fri, Mar 28, 14:55

Thanks my friend. I 100% understand the problem and I'm happy you shared the stack trace in the task and I'm happy about this test plan that helped me to reproduce,

However the current implementation raises some considerations to me:

  1. checking for the .git directory before running git is a micro-optimization that has sense only for your specific use-case, that is an un-official way to install Phorge/Phabricator.
    • As solution, probably we should just execute git normally like before, but intercepting the specific exception fatal: not a git repository (or any of the parent directories): .git and just do not log anything in that specific case.
      • In this sense, I'm probably the cause of your pain, since I've "improved" the config page to log such errors. So really you are able to report T16023 because of T15243
  2. whenever we may want to introduce such micro-optimization, or not; you may still want to run that inside a Future, object, (I mean, just like it's happening in the git commands) so that the filesystem check can be parallelized and you do not introduce extra "N+1 performance issue" (some doc here https://we.phorge.it/book/contrib/article/n_plus_one/ ). Specifically, running the filesystem check in parallel in both Arcanist and Phorge is better than checking one after one. This may sound silly for 2 libraries, but think about installations with more extensions, and I'm more than 1% sure that the would be shown there.

What do you think about both points? Note that probably we can ignore the second point if we agree on the first. Thanks my friend and happy Phorging

Update to detect stderr messages

src/applications/config/controller/PhabricatorConfigConsoleController.php
384

You can probably omit this line 376 thanks to line 354

Remove duplicated assignments to $stderr

This revision is now accepted and ready to land.Fri, Mar 28, 15:52