1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 06:42:42 +01:00

Audit Feed: less verbose when the author is the committer

Summary:
If the author and the committer are the same person, do not show them twice.

From:

    UsernameFoo committed <commit hash>: <commit msg> (authored by UsernameFoo).

To:

    UsernameFoo committed <commit hash>: <commit msg>

This only affects the feed.

| Before    | After  |
|-----------|-----------|
| {F342758} | {F342764} |

Closes T15528

Test Plan: Do some mixed commits and visit /feed/query/all/. No nuclear implosions.

Reviewers: O1 Blessed Committers, speck

Reviewed By: O1 Blessed Committers, speck

Subscribers: speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15528

Differential Revision: https://we.phorge.it/D25421
This commit is contained in:
Valerio Bozzolan 2023-11-15 13:56:04 +01:00
parent 282e37aaf6
commit 775d141fe6

View file

@ -338,7 +338,17 @@ final class PhabricatorAuditTransaction
$author = null; $author = null;
} }
if ($author) { // Show both Author and Committer only if they are different.
$show_both = $author && $committer;
if ($show_both) {
if ($new['authorPHID']) {
$show_both = $new['authorPHID'] !== $new['committerPHID'];
} else if (phutil_nonempty_string($new['authorName'])) {
$show_both = $new['authorName'] !== $new['committerName'];
}
}
if ($show_both) {
$title = pht( $title = pht(
'%s committed %s (authored by %s).', '%s committed %s (authored by %s).',
$committer, $committer,