MarkTraceur has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/95572


Change subject: Transfer inline count to a separate field
......................................................................

Transfer inline count to a separate field

"(2 comments)" has never been a useful comment summary. NEVER.

Change-Id: Id1ea5cae3dcf01a3411a24bdf5cd8c727f050353
---
M src/preprocess.js
1 file changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/grrrit 
refs/changes/72/95572/1

diff --git a/src/preprocess.js b/src/preprocess.js
index eac3327..8355037 100644
--- a/src/preprocess.js
+++ b/src/preprocess.js
@@ -60,12 +60,21 @@
         url: message.change.url,
         owner: message.change.owner.name
     };
-    var comment = message.comment.replace(/^\s*Patch Set \d+:.*$/m, 
'').trim().split("\n")[0].trim();
+    var inlineCount = message.comment.match(/(?:^|\s)\((\d+) 
comments\)(?:$|\s)/)[1],
+        comment = message.comment
+        // Strip out useless first line
+        .replace(/^\s*Patch Set \d+:.*$/m, '')
+        // Strip out count of inline comments
+        .replace(/^\s*\(\d+ comments\)$/m, '')
+        .trim().split("\n")[0].trim();
     if(!comment) {
         comment = message.change.subject.substring(0, 140);
     } else {
         comment = '"' + comment.substring(0, 138) + '"';
     }
+    if(inlineCount) {
+        ret.inlineComments = inlineCount;
+    }
     ret.message = comment;
     if(message.approvals) {
         ret.approvals = {};

-- 
To view, visit https://gerrit.wikimedia.org/r/95572
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id1ea5cae3dcf01a3411a24bdf5cd8c727f050353
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/grrrit
Gerrit-Branch: master
Gerrit-Owner: MarkTraceur <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to