9a91dbec708242c5edb4d601441544038c52ac79
chmalee
  Fri May 21 10:31:18 2021 -0700
Only generate git reports for non github contributors, refs #27336

diff --git src/utils/git-reports/git-reports.c src/utils/git-reports/git-reports.c
index b2a7461..cc6afea 100644
--- src/utils/git-reports/git-reports.c
+++ src/utils/git-reports/git-reports.c
@@ -19,31 +19,33 @@
 
 
 struct hash *userHash = NULL;
 struct slName *users = NULL;
 
 char *startTag = NULL;
 char *endTag = NULL;
 char *startDate = NULL;
 char *endDate = NULL;
 char *title = NULL;
 char *repoDir = NULL;
 char *outDir = NULL;
 char *outPrefix = NULL;
 int  contextSize;
 
-char gitCmd[1024];
+// command to filter out commits from non-GB members:
+char *getUsersCmd = "getent group kentcommit | cut -d':' -f4 | sed -e 's/^\\|,/ --author=/g'";
+char gitCmd[4096];
 char *tempMakeDiffName = NULL;
 
 struct files
     {
     struct files *next;
     char type;
     char *path;
     int linesChanged;
     };
 
 struct commit 
     {
     struct commit *next;
     int commitNumber;    // used for sorting fileviews
     char *commitId;
@@ -94,32 +96,32 @@
 void runShell(char *cmd)
 /* Run a command and do simple error-checking */
 {
 int exitCode = system(cmd);
 if (exitCode != 0)
     errAbort("system command [%s] failed with exitCode %d", cmd, exitCode);
 }
 
 void makeDiffAndSplit(struct commit *c, char *u, boolean full);  // FOREWARD REFERENCE
 
 struct commit* getCommits()
 /* Get all commits from startTag to endTag */
 {
 int numCommits = 0;
 safef(gitCmd,sizeof(gitCmd), ""
-"git log %s..%s --name-status > commits.tmp"
-, startTag, endTag);
+"validUsers=$(%s); git log %s..%s --name-status --color=never ${validUsers} > commits.tmp"
+, getUsersCmd, startTag, endTag);
 runShell(gitCmd);
 struct lineFile *lf = lineFileOpen("commits.tmp", TRUE);
 int lineSize;
 char *line;
 struct commit *commits = NULL, *commit = NULL;
 struct files *files = NULL, *f = NULL;
 while (lineFileNext(lf, &line, &lineSize))
     {
     
     char *w = nextWord(&line);
     AllocVar(commit);
     if (!sameString("commit", w))
 	lineFileAbort(lf, "expected keyword commit parsing commits.tmp\n");
     commit->commitId = cloneString(nextWord(&line));
     commit->commitNumber = ++numCommits;