e42144c1f1f50cda2fb720b8586660641480a4f1 jcasper Mon Feb 10 14:59:25 2025 -0800 Fixing git-reports for rename and copy changes, no ticket diff --git src/utils/git-reports/git-reports.c src/utils/git-reports/git-reports.c index 1d79fe4d571..d204532abee 100644 --- src/utils/git-reports/git-reports.c +++ src/utils/git-reports/git-reports.c @@ -186,30 +186,37 @@ /* collect the files-list */ while (lineFileNext(lf, &line, &lineSize)) { if (startsWith("commit ", line)) { lineFileReuse(lf); // extremely rare case of commit with no file lines break; } if (sameString("", line)) break; w = nextWord(&line); if (startsWith("src/hg/js/react/bundle/", line)) continue; AllocVar(f); f->type = w[0]; + /* Changes of type C and R (copy and rename) have two filenames - the old and the new. + * We need f->path to reflect the new filename so that the HTML filename is constructed + * appropriately and git-reports can easily find the relevant diff.txt file (which is also + * constructed using the new filename). So if there are two filenames, skip to the second here. + */ + if (strrchr(line, '\t') != NULL) + line = strrchr(line, '\t')+1; f->path = cloneString(line); slAddHead(&files, f); } slReverse(&files); commit->files = files; } if (!startsWith("Merge branch 'master' of", commit->comment) && !endsWith(commit->comment, "elease log update")) /* filter out automatic release log commits */ slAddHead(&commits, commit); verbose(2, "commitId: %s\n"