@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.

Show repository information (and use repository identities) in commit hovercards

Summary:
Ref T12164. Ref T13439. Commit hovercards don't currently show the repository. Although this is sometimes obvious from context, it isn't at other times and it's clearly useful/important.

Also, use identities to render author/committer information and show committer if the committer differs from the author.

Test Plan: {F6989595}

Maniphest Tasks: T13439, T12164

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

+34 -9
+34 -9
src/applications/diffusion/engineextension/DiffusionHovercardEngineExtension.php
··· 26 26 27 27 $viewer = $this->getViewer(); 28 28 29 - $author_phid = $commit->getAuthorPHID(); 30 - if ($author_phid) { 31 - $author = $viewer->renderHandle($author_phid); 32 - } else { 33 - $commit_data = $commit->loadCommitData(); 34 - $author = phutil_tag('em', array(), $commit_data->getAuthorName()); 29 + $commit = id(new DiffusionCommitQuery()) 30 + ->setViewer($viewer) 31 + ->needIdentities(true) 32 + ->needCommitData(true) 33 + ->withPHIDs(array($commit->getPHID())) 34 + ->executeOne(); 35 + if (!$commit) { 36 + return; 35 37 } 36 38 39 + $author_phid = $commit->getAuthorDisplayPHID(); 40 + $committer_phid = $commit->getCommitterDisplayPHID(); 41 + $repository_phid = $commit->getRepository()->getPHID(); 42 + 43 + $phids = array(); 44 + $phids[] = $author_phid; 45 + $phids[] = $committer_phid; 46 + $phids[] = $repository_phid; 47 + 48 + $handles = $viewer->loadHandles($phids); 49 + 37 50 $hovercard->setTitle($handle->getName()); 38 51 $hovercard->setDetail($commit->getSummary()); 39 52 40 - $hovercard->addField(pht('Author'), $author); 41 - $hovercard->addField(pht('Date'), 42 - phabricator_date($commit->getEpoch(), $viewer)); 53 + $repository = $handles[$repository_phid]->renderLink(); 54 + $hovercard->addField(pht('Repository'), $repository); 55 + 56 + $author = $handles[$author_phid]->renderLink(); 57 + if ($author_phid) { 58 + $hovercard->addField(pht('Author'), $author); 59 + } 60 + 61 + if ($committer_phid && ($committer_phid !== $author_phid)) { 62 + $committer = $handles[$committer_phid]->renderLink(); 63 + $hovercard->addField(pht('Committer'), $committer); 64 + } 65 + 66 + $date = phabricator_date($commit->getEpoch(), $viewer); 67 + $hovercard->addField(pht('Date'), $date); 43 68 44 69 if (!$commit->isAuditStatusNoAudit()) { 45 70 $status = $commit->getAuditStatusObject();