[codeface] Re: [PATCH 1/2] Add query to get commits by date

  • From: Mitchell Joblin <joblin.m@xxxxxxxxx>
  • To: codeface@xxxxxxxxxxxxx
  • Date: Thu, 8 Oct 2015 11:18:55 +0200

On Wed, Oct 7, 2015 at 4:42 PM, Wolfgang Mauerer <wm@xxxxxxxxxxxxxxxx> wrote:

Hi Mitchell,

Am 07/10/2015 um 16:30 schrieb Mitchell Joblin:
Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@xxxxxxxxxxx>
---
codeface/R/query.r | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/codeface/R/query.r b/codeface/R/query.r
index 15016fd..cadbe9e 100644
--- a/codeface/R/query.r
+++ b/codeface/R/query.r
@@ -181,6 +181,15 @@ get.commits.by.ranges <- function(conf, subset=NULL,
FUN=NULL) {
return(ts)
}

+get.commits.by.date.con <- function(con, pid, start.date, end.date) {

thanks, that's a useful helper function.
+ query <- str_c("SELECT * FROM commit",
+ " WHERE projectId= ",pid,
+ " AND commitDate > ", sq(start.date),
+ " AND commitDate < ", sq(end.date))

Would it make sense to also allow for querying by author (instead
of committer) date? You could, for instance, select using a
default-TRUE parameter committerDate.

That's no problem. I have added this now, but I won't bother to repost
it here. You can check it in the pull request if you like.

thanks,

Mitchell


Otherwise:
Acked-by: Wolfgang Mauerer <wolfgang.mauerer@xxxxxxxxxxxxxxxxx>

Thanks, Wolfgang

+ dat <- dbGetQuery(con, query)
+ return(dat)
+}
+
## Obtain commit information for a specific cycle of a project
get.commits.by.range.con <- function(con, pid, range.id, subset=NULL,
FUN=NULL) {
dat <- dbGetQuery(con, str_c("SELECT * FROM commit where projectId=",



Other related posts: