@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Warn when 'git-http-backend' is not on the PATH.

Summary:
Currently if 'git-http-backend' is not on the PATH, there is no visible message to the user other than "info/refs: is this a valid git repository?" when trying to clone. This adds a setup check so that if there are any Git repositories in use, it will check for the existance of the "git-http-backend" binary in the PATH.

I believe this is shipped by default alongside the git package on most distros, but in some (such as OpenSUSE), this binary isn't on the PATH by default.

Test Plan: Removed `/usr/lib/git` from my `environment.append-paths` and saw the message appear. Added it back and the message went away.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Maniphest Tasks: T4050

Differential Revision: https://secure.phabricator.com/D7488

authored by

James Rhodes and committed by
epriestley
10659ece 4f205308

+58
+58
src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
··· 597 597 return $view; 598 598 } 599 599 600 + if ($repository->isHosted()) { 601 + $binaries = array(); 602 + if ($repository->getServeOverHTTP() != PhabricatorRepository::SERVE_OFF) { 603 + switch ($repository->getVersionControlSystem()) { 604 + case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: 605 + $binaries['Git HTTP serve'] = 'git-http-backend'; 606 + break; 607 + case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: 608 + $binaries['SVN serve'] = 'svnserve'; 609 + $binaries['SVN admin'] = 'svnadmin'; 610 + break; 611 + case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: 612 + $binaries['Mercurial'] = 'hg'; 613 + break; 614 + } 615 + } 616 + if ($repository->getServeOverSSH() != PhabricatorRepository::SERVE_OFF) { 617 + switch ($repository->getVersionControlSystem()) { 618 + case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: 619 + $binaries['Git SSH receive'] = 'git-receive-pack'; 620 + $binaries['Git SSH upload'] = 'git-upload-pack'; 621 + break; 622 + case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: 623 + $binaries['SVN serve'] = 'svnserve'; 624 + $binaries['SVN admin'] = 'svnadmin'; 625 + break; 626 + case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: 627 + $binaries['Mercurial'] = 'hg'; 628 + break; 629 + } 630 + } 631 + $binaries = array_unique($binaries); 632 + foreach ($binaries as $name => $binary) { 633 + if (!Filesystem::binaryExists($binary)) { 634 + $view->addItem( 635 + id(new PHUIStatusItemView()) 636 + ->setIcon('warning-red') 637 + ->setTarget(pht( 638 + '%s tool not found in PATH', 639 + $name)) 640 + ->setNote(pht( 641 + 'You may need to configure %s.', 642 + phutil_tag('tt', array(), 'environment.append-paths')))); 643 + } else { 644 + $view->addItem( 645 + id(new PHUIStatusItemView()) 646 + ->setIcon('accept-green') 647 + ->setTarget(pht( 648 + '%s tool found', 649 + $name)) 650 + ->setNote(phutil_tag( 651 + 'tt', 652 + array(), 653 + Filesystem::resolveBinary($binary)))); 654 + } 655 + } 656 + } 657 + 600 658 $doc_href = PhabricatorEnv::getDocLink( 601 659 'article/Managing_Daemons_with_phd.html'); 602 660 $daemon_instructions = pht(