381e3eb3f51fbf88c9565a575c21fa8297fb93a1 galt Wed Mar 3 05:04:06 2010 -0800 added users-page diff --git git-reports.c git-reports.c index c6b2d28..4cdd62f 100644 --- git-reports.c +++ git-reports.c @@ -253,8 +253,14 @@ safef(userPath, sizeof(userPath), "%s/%s/%s/%s/index.html", outDir, outPrefix, "user", u); FILE *h = mustOpen(userPath, "w"); -fprintf(h, "\n
\n\n", u); -fprintf(h, "Commits for %s
\n", u); +fprintf(h, "\n\n%s Commits View \n\n\n", u); +fprintf(h, "Commits for %s
\n", u); + +//switch to grouped by file view, user index +fprintf(h, "%s to %s (%s to %s) %s
\n", startTag, endTag, startDate, endDate, title); + +fprintf(h, "\n"); + int userLinesChanged = 0; int userFileCount = 0; // TODO do we want to not count the same file twice? @@ -424,6 +430,20 @@ if (!fileExists(path) && mkdir(path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0) errnoAbort("unable to mkdir %s", path); + +char usersPath[1024]; +safef(usersPath, sizeof(usersPath), "%s/%s/%s/index.html", outDir, outPrefix, "user"); + +FILE *h = mustOpen(usersPath, "w"); +fprintf(h, "\n\nGit Changes By User \n\n\n"); +fprintf(h, "Git Changes By User
\n"); + +fprintf(h, "%s to %s (%s to %s) %s
\n", startTag, endTag, startDate, endDate, title); + +fprintf(h, "\n"); + + + struct slName*u; for(u = users; u; u = u->next) { @@ -444,17 +464,28 @@ if (!fileExists(path) && mkdir(path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0) errnoAbort("unable to mkdir %s", path); + userChangedLines = 0; + userChangedFiles = 0; + // DEBUG REMOVE //if (sameString(u->name, "galt")) /* make user's reports */ doUser(u->name, commits, &userChangedLines, &userChangedFiles); + char relPath[1024]; + safef(relPath, sizeof(relPath), "%s/index.html", u->name); + fprintf(h, " %s - changed lines: %d, files: %d\n", relPath, u->name, userChangedLines, userChangedFiles); + totalChangedLines += userChangedLines; totalChangedFiles += userChangedFiles; // TODO do we have to worry about counting the same file more than once? } +fprintf(h, "\n lines changed: %d\n files changed: %d\n", totalChangedLines, totalChangedFiles); + +fprintf(h, "\n