Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2644852
D25029.1732340823.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
3 KB
Referenced Files
None
Subscribers
None
D25029.1732340823.diff
View Options
diff --git a/src/repository/api/ArcanistGitAPI.php b/src/repository/api/ArcanistGitAPI.php
--- a/src/repository/api/ArcanistGitAPI.php
+++ b/src/repository/api/ArcanistGitAPI.php
@@ -189,6 +189,28 @@
list($commit, $tree, $parents, $time, $author, $author_email,
$title, $message) = explode("\1", trim($line), 8);
$message = rtrim($message);
+ $co_authors = array();
+
+ foreach (explode("\n", $message) as $message_line) {
+ if (strncasecmp($message_line, 'Co-authored-by:', 15) !== 0) {
+ continue;
+ }
+
+ $matches = array();
+ $status = preg_match(
+ '/^co-authored-by:\s*(.*)<(.*)>/i',
+ $message_line,
+ $matches);
+
+ if ($status !== 1) {
+ continue;
+ }
+
+ $co_authors[] = array(
+ 'name' => trim($matches[1]),
+ 'email' => trim($matches[2]),
+ );
+ }
$commits[$commit] = array(
'commit' => $commit,
@@ -199,6 +221,7 @@
'summary' => $title,
'message' => $message,
'authorEmail' => $author_email,
+ 'coAuthors' => $co_authors,
);
}
diff --git a/src/repository/api/ArcanistMercurialAPI.php b/src/repository/api/ArcanistMercurialAPI.php
--- a/src/repository/api/ArcanistMercurialAPI.php
+++ b/src/repository/api/ArcanistMercurialAPI.php
@@ -202,6 +202,7 @@
$parents, $desc) = explode("\1", $log, 9);
list($author, $author_email) = $this->parseFullAuthor($full_author);
+ $co_authors = array();
// NOTE: If a commit has only one parent, {parents} returns empty.
// If it has two parents, {parents} returns revs and short hashes, not
@@ -223,6 +224,28 @@
$node);
}
+
+ foreach (explode("\n", $desc) as $line) {
+ if (strncasecmp($line, 'Co-authored-by:', 15) !== 0) {
+ continue;
+ }
+
+ $matches = array();
+ $status = preg_match(
+ '/^co-authored-by:\s*(.*)<(.*)>/i',
+ $line,
+ $matches);
+
+ if ($status !== 1) {
+ continue;
+ }
+
+ $co_authors[] = array(
+ 'name' => $matches[1],
+ 'email' => $matches[2],
+ );
+ }
+
$commits[$node] = array(
'author' => $author,
'time' => strtotime($date),
@@ -235,6 +258,7 @@
'summary' => head(explode("\n", $desc)),
'message' => $desc,
'authorEmail' => $author_email,
+ 'coAuthors' => $co_authors,
);
$last_node = $node;
diff --git a/src/workflow/ArcanistWorkflow.php b/src/workflow/ArcanistWorkflow.php
--- a/src/workflow/ArcanistWorkflow.php
+++ b/src/workflow/ArcanistWorkflow.php
@@ -968,6 +968,11 @@
return $working_copy;
}
+ /**
+ * @param ArcanistRepositoryAPI<mixed> $api
+ *
+ * @return self<mixed>
+ */
final public function setRepositoryAPI($api) {
$this->repositoryAPI = $api;
return $this;
@@ -981,6 +986,9 @@
}
}
+ /**
+ * @return ArcanistRepositoryAPI<mixed>
+ */
final public function getRepositoryAPI() {
$configuration_engine = $this->getConfigurationEngine();
if ($configuration_engine) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 05:47 (15 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
980418
Default Alt Text
D25029.1732340823.diff (3 KB)
Attached To
Mode
D25029: Co-Author support in arc land T15044
Attached
Detach File
Event Timeline
Log In to Comment