From 3f451cfcb115a8112a342120913095641891001f Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Sun, 23 Jun 2024 23:20:01 +0200 Subject: [PATCH] fix(commit): Fixed issue with retrieving uncommitted diffs in git repository --- changelog.md | 7 +++++++ ts/00_commitinfo_data.ts | 2 +- ts/aidocs_classes/commit.ts | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 9553d3e..cbf6738 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2024-06-23 - 1.3.6 - fix(commit) +Fixed issue with retrieving uncommitted diffs in git repository + +- Revised logic to correctly handle uncommitted changes by using an array for `getUncommittedDiff` method +- Ensured proper handling and representation of uncommitted changes in the output + + ## 2024-06-23 - 1.3.5 - fix(aidocs_classes) Refactor and enhance changelog formatting diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index c9d2b5c..70e66de 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@git.zone/tsdoc', - version: '1.3.5', + version: '1.3.6', description: 'An advanced TypeScript documentation tool using AI to generate and enhance documentation for TypeScript projects.' } diff --git a/ts/aidocs_classes/commit.ts b/ts/aidocs_classes/commit.ts index e072c63..85e0b4a 100644 --- a/ts/aidocs_classes/commit.ts +++ b/ts/aidocs_classes/commit.ts @@ -27,7 +27,7 @@ export class Commit { smartgitInstance, this.projectDir ); - const diffString = await gitRepo.getUncommittedDiff(); + const diffStringArray = await gitRepo.getUncommittedDiff(['pnpm-lock.json']); const projectContext = new ProjectContext(this.projectDir); let contextString = await projectContext.update(); contextString = ` @@ -35,7 +35,7 @@ ${contextString} Below is the diff of the uncommitted changes. If nothing is changed, there are no changes: -${diffString || 'No changes.'} +${diffStringArray[0] ? diffStringArray.join('\n\n') : 'No changes.'} `; let result = await this.aiDocsRef.openaiInstance.chat({