]> Lady’s Gitweb - GitWikiWeb/commitdiff
Fix old recently changed files 0.1.2
authorLady <redacted>
Fri, 28 Jul 2023 08:38:33 +0000 (01:38 -0700)
committerLady <redacted>
Fri, 28 Jul 2023 08:38:33 +0000 (01:38 -0700)
The final comparison should be between the old commit and HEAD, not
between the old commit and its parent.

build.js

index b0df7c074b89343d93fb26373ea6cf2cbfcef966..df9c016600b3fdf9539de47d162d7ff944fc9dc9 100644 (file)
--- a/build.js
+++ b/build.js
@@ -173,7 +173,7 @@ const listOfInternalLinks = (references, wrapper = ($) => $) => ({
   ),
 });
 
-const diffReferences = async (hash) => {
+const diffReferences = async (hash, againstHead = false) => {
   const diff = new Deno.Command("git", {
     args: [
       "diff-tree",
@@ -182,7 +182,7 @@ const diffReferences = async (hash) => {
       "--name-only",
       "--no-renames",
       "--diff-filter=AM",
-      hash,
+      ...(againstHead ? [hash, "HEAD"] : [hash]),
     ],
     stdout: "piped",
     stderr: "piped",
@@ -692,7 +692,9 @@ class GitWikiWebPage {
           ]).then(logErrorsAndCollectResults);
           const refs = [];
           current = hash;
-          for (const ref of (await diffReferences(current))) {
+          for (
+            const ref of (await diffReferences(current, !recency))
+          ) {
             if (seen.has(ref)) {
               /* do nothing */
             } else {
@@ -700,7 +702,7 @@ class GitWikiWebPage {
               seen.add(ref);
             }
           }
-          results[recency] = { dateTime, humanReadable, refs };
+          results[recency] = { dateTime, hash, humanReadable, refs };
         } while (recency-- > 0 && current && current != commit);
         return results;
       })(),
This page took 0.024638 seconds and 4 git commands to generate.