From 176b46271388a78759cf79f74f625e41aaa7aa22 Mon Sep 17 00:00:00 2001 From: Maxime Durand <72691393+Maxim-Durand@users.noreply.github.com> Date: Sat, 6 Apr 2024 18:55:09 -0400 Subject: [PATCH 1/2] Auto appending commit file path from repo root instead of execution dir --- packages/core/src/git.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/src/git.ts b/packages/core/src/git.ts index 09dccc6e2..5719e1124 100644 --- a/packages/core/src/git.ts +++ b/packages/core/src/git.ts @@ -379,13 +379,17 @@ export default class Git { includeMergeCommitFiles: true, }); + const repoRootPath = execSync("git rev-parse --show-toplevel", { + encoding: "utf8", + }).trim(); + return log .map((commit) => ({ hash: commit.hash, authorName: commit.authorName, authorEmail: commit.authorEmail, subject: commit.rawBody!, - files: (commit.files || []).map((file) => path.resolve(file)), + files: (commit.files || []).map((file) => path.resolve(repoRootPath,file)), })) .reduce((all, commit) => { // The -m option will list a commit for each merge parent. This From 3a698e09cc0ec1df4734e7d1c3e46026d1b91180 Mon Sep 17 00:00:00 2001 From: Maxime Durand <72691393+Maxim-Durand@users.noreply.github.com> Date: Thu, 11 Apr 2024 08:25:08 -0400 Subject: [PATCH 2/2] Added import { execSync } from "child_process"; --- packages/core/src/git.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/core/src/git.ts b/packages/core/src/git.ts index 5719e1124..edf2c6892 100644 --- a/packages/core/src/git.ts +++ b/packages/core/src/git.ts @@ -11,6 +11,7 @@ import on from "await-to-js"; import join from "url-join"; import { gt, lt } from "semver"; import prettyMs from "pretty-ms"; +import { execSync } from "child_process"; import { Memoize as memoize } from "typescript-memoize";