From 775d141fe6bf4ce1f7e596dd856962f054f16d1a Mon Sep 17 00:00:00 2001 From: Valerio Bozzolan Date: Wed, 15 Nov 2023 13:56:04 +0100 Subject: [PATCH] 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 : (authored by UsernameFoo). To: UsernameFoo committed : 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 --- .../audit/storage/PhabricatorAuditTransaction.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/applications/audit/storage/PhabricatorAuditTransaction.php b/src/applications/audit/storage/PhabricatorAuditTransaction.php index e6c1062092..8e49d99520 100644 --- a/src/applications/audit/storage/PhabricatorAuditTransaction.php +++ b/src/applications/audit/storage/PhabricatorAuditTransaction.php @@ -338,7 +338,17 @@ final class PhabricatorAuditTransaction $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( '%s committed %s (authored by %s).', $committer,