Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add commit message merge functionality #193

Merged
merged 43 commits into from
Feb 3, 2021
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9589e52
Add test commit message data
nlschn Dec 13, 2020
85b1d05
Add new function to read commit messages
nlschn Dec 13, 2020
61618db
Change commitMessages.list test files to have for the right line breaks
nlschn Dec 16, 2020
17a61ed
Adapt commit message read test to new test files
nlschn Dec 16, 2020
c624c90
Adapt read.commit.messages to handle line breaks correctly
nlschn Dec 16, 2020
fdc414a
Add functions that enable merging commit messages into data
nlschn Dec 21, 2020
5db90d8
Add new configuration option for commit messages
nlschn Dec 21, 2020
f80b24b
Replace seq with seq_along and add missing log statement in util-read.R
nlschn Dec 21, 2020
9414357
Add tests for merging and fix bug when merging only titles
nlschn Dec 28, 2020
359b12c
Add description of changes to unversioned section of NEWS.md
nlschn Jan 2, 2021
70c8395
Remove unnecessary empty lines from several files
nlschn Jan 7, 2021
89a6ea6
Fix a syntax error in util-read
nlschn Jan 7, 2021
6e9147e
Fix merging by hash instead of commit.id
nlschn Jan 8, 2021
c9c7ff7
Modify README and NEWS
nlschn Jan 13, 2021
0457dd5
Rename "message.body" column to "message" everywhere
nlschn Jan 13, 2021
7e61dcb
Fix style issues and improve message processing
nlschn Jan 13, 2021
8e28a1f
Put merge functionality into own function
nlschn Jan 13, 2021
703ab3e
Fix error when returning a variable that is not defined
nlschn Jan 13, 2021
7caaa8d
Simplify data frame creation in read.commit.messages
nlschn Jan 15, 2021
8dd410c
Reorder functions in util read and replace special functions
nlschn Jan 15, 2021
eb1cec8
Fix comments in and change order in 'set.commits'
nlschn Jan 15, 2021
d5c8c78
Add helper function to format 'commit.id' column
nlschn Jan 15, 2021
43e1894
Change commit message merge process
nlschn Jan 15, 2021
70b3cb6
Change order of data sources to be alphabetical
nlschn Jan 16, 2021
31e0f85
Update 'NEWS.md' with commit hashes
nlschn Jan 16, 2021
a0d5e32
Add package 'data.table' to coronet and refactor README
nlschn Jan 20, 2021
4c49269
Increase perfomance of commit message read
nlschn Jan 20, 2021
19655dd
Update my copyright notices
nlschn Jan 20, 2021
a36bde4
Fix spelling errors in 'README.md' and 'util-conf.R'
nlschn Jan 20, 2021
aab0751
Use new helper function in tests to format commit ids
nlschn Jan 25, 2021
0859b9a
Replace for-loop with lapply call in function to read commit messages
nlschn Jan 25, 2021
fc5d20f
Fix minor comment issues and add checks before updating commit messages
nlschn Jan 25, 2021
686459e
Initialize commit message data on RangeData-objects in 'util-split.R'
nlschn Jan 25, 2021
613a773
Fix minor spelling errors
nlschn Jan 25, 2021
98e83b0
Change all data split tests to include commit message data
nlschn Jan 25, 2021
2e42fca
Change all sliding window data tests to include commit message data
nlschn Jan 25, 2021
c052dfb
Fix minor comment issue in 'test-split-sliding-window.R'
nlschn Jan 26, 2021
d3bbae0
Add new cleanup functions for commit messages and synchronicity
nlschn Jan 30, 2021
9385084
Fix wrong variable name in 'cleanup.synchronicity'
nlschn Jan 30, 2021
63b6f79
Add cleanup functions to NEWS.md
nlschn Feb 1, 2021
c63a25a
Remove unnecassary function calls and add logging output
nlschn Feb 1, 2021
e1e1ba8
Fix regex when filtering out spaces and change data frame assignment
nlschn Feb 1, 2021
18843a8
Fix problems in CI pipeline for R-3.3
bockthom Feb 3, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion util-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
## Copyright 2017 by Ferdinand Frank <[email protected]>
## Copyright 2018-2019 by Jakob Kronawitter <[email protected]>
## Copyright 2019-2020 by Anselm Fehnker <[email protected]>
## Copyright 2020 by Niklas Schneider <[email protected]>
## All Rights Reserved.


Expand Down Expand Up @@ -104,6 +105,7 @@ ProjectData = R6::R6Class("ProjectData",
## commits and commit data
commits.filtered = NULL, # data.frame
commits = NULL, # data.frame
commit.messages = NULL, # data.frame
## mails
mails = NULL, # data.frame
mails.patchstacks = NULL, # list
Expand Down Expand Up @@ -508,6 +510,7 @@ ProjectData = R6::R6Class("ProjectData",
reset.environment = function() {
private$commits.filtered = NULL
private$commits = NULL
private$commit.messages = NULL
private$mails = NULL
private$issues = NULL
private$authors = NULL
Expand Down Expand Up @@ -671,8 +674,27 @@ ProjectData = R6::R6Class("ProjectData",
return(private$commits)
},

#' Get the list of commits which have the artifact kind configured in the \code{project.conf}.
#' If the list of commits is not cached in the field \code{commit.messages}, call the read method first.
#'
#' @return the list of commit messages
get.commit.messages = function() {
bockthom marked this conversation as resolved.
Show resolved Hide resolved
logging::loginfo("Getting commit messages.´")

## if commit messages are not read already, do this
if (is.null(private$commit.messages)) {
commit.message.data = read.commit.messages(self$get.data.path())

## cache the result
private$commit.messages = commit.message.data
}

return(commit.message.data)
bockthom marked this conversation as resolved.
Show resolved Hide resolved
},

#' Set the commit list of the project to a new one.
#' Add PaStA and sychronicity data if configured in the \code{project.conf}.
#' Add PaStA and synchronicity data if configured in the \code{project.conf}
#' as well as commit message data.
#'
#' @param commit.data the new list of commits
set.commits = function(commit.data) {
Expand All @@ -682,6 +704,27 @@ ProjectData = R6::R6Class("ProjectData",
commit.data = create.empty.commits.list()
}


## add commit message data if wanted
if (private$project.conf$get.value("commit.messages") != "none") {
bockthom marked this conversation as resolved.
Show resolved Hide resolved
logging::loginfo("Merging commit messages into commit data.")

## get commit messages
commit.messages = self$get.commit.messages()

## drop the hash column as we do not want it twice
commit.messages = commit.messages = commit.messages[-2]

## now there are only three columns left: commit.id, title, message.body
## check whether to include only title or also the messages
if (private$project.conf$get.value("commit.messages") == "title") {
commit.messages = commit.messages[-2]
}

## merge them into the commit data
commit.data = merge(commit.data, commit.messages, by = "commit.id")
}

## store commit data
private$commits = commit.data

Expand All @@ -707,6 +750,7 @@ ProjectData = R6::R6Class("ProjectData",
}
}


## sort by date
private$commits = private$commits[order(private$commits[["date"]], decreasing = FALSE), ]

Expand Down