This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let numberOfAuthors = | |
totalCommits | |
|> Array.groupBy(fun c -> c.CommitInfo.Author) | |
|> Array.length | |
---------------------------------------------------- | |
val numberOfAuthors : int = 22 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let numberOfEntitiesChanged = | |
totalCommits | |
|> Array.collect(fun c -> c.Files) | |
|> Array.length | |
----------------------------------------------- | |
val numberOfEntitiesChanged : int = 37765 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let numberOfEntities = | |
totalCommits | |
|> Array.collect(fun c -> c.Files) | |
|> Array.groupBy(fun f -> f.FileName) | |
|> Array.length | |
-------------------------------------------- | |
val numberOfEntities : int = 8119 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let numberOfCommits = totalCommits |> Array.length | |
------------------------------------------- | |
val numberOfCommits : int = 5061 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type CommitInfo = {Hash : string; Author : string; TimeStamp : DateTime; Message : string} | |
type CommittedFile = {LinesAdded: int option; LinesDeleted: int option; FileName: string} | |
type Commit = {CommitInfo: CommitInfo; Files: CommittedFile[]} | |
val totalCommits : Commit [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "../packages/FSharp.Data.2.2.5/lib/net40/FSharp.Data.dll" | |
open System | |
open System.IO | |
open FSharp.Data | |
[<Literal>] | |
let lineBreak = "\r\n" | |
type CommitInfo = {Hash : string; Author : string; TimeStamp : DateTime; Message : string} | |
type CommittedFile = {LinesAdded: int option; LinesDeleted: int option; FileName: string} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let totalCommits = | |
commits | |
|> Array.map extractCommitInfo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let extractCommitInfo (commit:string) = | |
let isCommitInfoLine (line: string) = | |
line.StartsWith("[") | |
let extractCommitedFilesInfo c = | |
let commitFileLine = CommitLineCsv.Parse(c).Rows |> Seq.head | |
{LinesAdded = commitFileLine.LinesAdded; LinesDeleted = commitFileLine.LinesDeleted; FileName = commitFileLine.FileName} | |
let commitLines = commit.Split([|lineBreak|], StringSplitOptions.RemoveEmptyEntries) | |
let commitInfoLine = commitLines |> Array.takeWhile(isCommitInfoLine) |> Array.last |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{CommitInfo = commitInfo; Files = fileRows} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type CommitLineCsv = CsvProvider<"LinesAdded\tLinesDeleted\tFile", HasHeaders = false, Schema = "LinesAdded(int option),LinesDeleted(int option),FileName"> | |
let extractCommitedFilesInfo c = | |
let commitFileLine = CommitLineCsv.Parse(c).Rows |> Seq.head | |
{LinesAdded = commitFileLine.LinesAdded; LinesDeleted = commitFileLine.LinesDeleted; FileName = commitFileLine.FileName} | |
let fileRows = fileLines |> Array.map extractCommitedFilesInfo |