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

Add a "USERS" section to audit emails listing commit authors and committers

Summary: Fixes T5872. This won't show up in the initial email until T4896 is further along.

Test Plan:
```
RECIPIENTS
discoball (Disco Ball)

BODY
epriestley added a comment.

ffkn

USERS
epriestley (Author)

COMMIT
http://local.aphront.com:8080/rPOEMS165b6c54f487
```

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5872

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

+43
+43
src/applications/audit/editor/PhabricatorAuditEditor.php
··· 428 428 $this->renderInlineCommentsForMail($object, $inlines)); 429 429 } 430 430 431 + // Reload the commit to pull commit data. 432 + $commit = id(new DiffusionCommitQuery()) 433 + ->setViewer($this->requireActor()) 434 + ->withIDs(array($object->getID())) 435 + ->needCommitData(true) 436 + ->executeOne(); 437 + $data = $commit->getCommitData(); 438 + 439 + $user_phids = array(); 440 + 441 + $author_phid = $commit->getAuthorPHID(); 442 + if ($author_phid) { 443 + $user_phids[$commit->getAuthorPHID()][] = pht('Author'); 444 + } 445 + 446 + $committer_phid = $data->getCommitDetail('committerPHID'); 447 + if ($committer_phid && ($committer_phid != $author_phid)) { 448 + $user_phids[$committer_phid][] = pht('Committer'); 449 + } 450 + 451 + // TODO: It would be nice to show pusher here too, but that information 452 + // is a little tricky to get at right now. 453 + 454 + if ($user_phids) { 455 + $handle_phids = array_keys($user_phids); 456 + $handles = id(new PhabricatorHandleQuery()) 457 + ->setViewer($this->requireActor()) 458 + ->withPHIDs($handle_phids) 459 + ->execute(); 460 + 461 + $user_info = array(); 462 + foreach ($user_phids as $phid => $roles) { 463 + $user_info[] = pht( 464 + '%s (%s)', 465 + $handles[$phid]->getName(), 466 + implode(', ', $roles)); 467 + } 468 + 469 + $body->addTextSection( 470 + pht('USERS'), 471 + implode("\n", $user_info)); 472 + } 473 + 431 474 $monogram = $object->getRepository()->formatCommitName( 432 475 $object->getCommitIdentifier()); 433 476