This is an automated email from the ASF dual-hosted git repository.
fanningpj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-management.git
The following commit(s) were added to refs/heads/main by this push:
new 583a9d79 Delete authors.scala (#223)
583a9d79 is described below
commit 583a9d793726d46ece1880452cf904718c938fcb
Author: PJ Fanning <[email protected]>
AuthorDate: Mon May 6 10:17:19 2024 +0100
Delete authors.scala (#223)
---
scripts/authors.scala | 69 ---------------------------------------------------
1 file changed, 69 deletions(-)
diff --git a/scripts/authors.scala b/scripts/authors.scala
deleted file mode 100755
index 3e8c66f5..00000000
--- a/scripts/authors.scala
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/sh
-exec scala "$0" "$@"
-!#
-
-/*
- * Usage:
- * authors.scala tag1 tag2
- *
- * or if on non unixy os:
- * scala authors.scala tag1 tag2
- *
- * requires scala 2.11.x+ and command line git on path
- */
-
-import scala.sys.process._
-
-require(args.length == 2, "usage: authors prevTag currTag")
-
-val gitCmd = "git log --no-merges --shortstat -z --minimal -w -C " + args(0) +
".." + args(1)
-
-case class Stats(name: String, email: String, commits: Int = 0, inserts: Int =
0, deletes: Int = 0, filesChanged: Int = 0)
-
-val AuthorExp = """Author: (.*) <([^>]+)>""".r
-val FilesExp = """(\d+)\sfile[s]? changed""".r
-val InsertionsExp = """(\d+)\sinsertion[s]?\(\+\)""".r
-val DeletionsExp = """(\d+)\sdeletion[s]?\(-\)""".r
-
-val entries = gitCmd.lineStream_!.foldLeft("")(_ + "\n" + _).split('\u0000')
-
-val map = entries.foldLeft(Map.empty[String, Stats]) { (map, entry) =>
- val lines = entry.trim.split('\n')
- val authorLine = lines(1)
- val summary = lines.last
-
- val statsEntry = authorLine match {
- case AuthorExp(name, email) =>
- map.get(name.toLowerCase).orElse {
- // look for same email, but different name
- map.values.find(_.email.equalsIgnoreCase(email)).orElse {
- Some(Stats(name, email))
- }
- }
- case _ =>
- println(s"Unparseable author line: \n$authorLine\n in entry $entry")
- None
- }
-
- val updatedEntry =
- statsEntry.map(entry =>
summary.trim.split(',').map(_.trim).foldLeft(entry.copy(commits = entry.commits
+ 1)) {
- case (entry, FilesExp(f)) => entry.copy(filesChanged =
entry.filesChanged + f.toInt)
- case (entry, InsertionsExp(a)) => entry.copy(inserts = entry.inserts +
a.toInt)
- case (entry, DeletionsExp(d)) => entry.copy(deletes = entry.deletes +
d.toInt)
- case (entry, uff) =>
- println(s"Couldn't parse summary section for $entry '$uff'")
- entry
- })
-
- updatedEntry.fold(
- map
- )(entry => map + (entry.name.toLowerCase -> entry))
-}
-
-val sorted = map.values.toSeq.sortBy(s => (s.commits, s.inserts +
s.deletes)).reverse
-
-println("commits added removed")
-sorted.foreach { entry =>
- println("%7d%7d%9d %s".format(entry.commits, entry.inserts, entry.deletes,
entry.name))
-}
-
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]