Skip to content

Commit b90dacd

Browse files
authored
bugs: ensure commit notes have no pager (#2596)
1 parent ce0ef2f commit b90dacd

File tree

1 file changed

+7
-7
lines changed
  • apps/web/client/src/components/store/editor/version

1 file changed

+7
-7
lines changed

apps/web/client/src/components/store/editor/version/git.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export class GitManager {
157157
*/
158158
async listCommits(maxRetries = 2): Promise<GitCommit[]> {
159159
let lastError: Error | null = null;
160-
160+
161161
for (let attempt = 0; attempt <= maxRetries; attempt++) {
162162
try {
163163
// Use a more robust format with unique separators and handle multiline messages
@@ -171,7 +171,7 @@ export class GitManager {
171171

172172
// If git command failed but didn't throw, treat as error for retry logic
173173
lastError = new Error(`Git command failed: ${result.error || 'Unknown error'}`);
174-
174+
175175
if (attempt < maxRetries) {
176176
// Wait before retry with exponential backoff
177177
await new Promise(resolve => setTimeout(resolve, Math.pow(2, attempt) * 100));
@@ -182,18 +182,18 @@ export class GitManager {
182182
} catch (error) {
183183
lastError = error instanceof Error ? error : new Error(String(error));
184184
console.warn(`Attempt ${attempt + 1} failed to list commits:`, lastError.message);
185-
185+
186186
if (attempt < maxRetries) {
187187
// Wait before retry with exponential backoff
188188
await new Promise(resolve => setTimeout(resolve, Math.pow(2, attempt) * 100));
189189
continue;
190190
}
191-
191+
192192
console.error('All attempts failed to list commits', lastError);
193193
return [];
194194
}
195195
}
196-
196+
197197
return [];
198198
}
199199

@@ -211,7 +211,7 @@ export class GitManager {
211211
const sanitizedDisplayName = sanitizeCommitMessage(displayName);
212212
const escapedDisplayName = prepareCommitMessage(sanitizedDisplayName);
213213
return this.runCommand(
214-
`git notes --ref=${ONLOOK_DISPLAY_NAME_NOTE_REF} add -f -m ${escapedDisplayName} ${commitOid}`,
214+
`git --no-pager notes --ref=${ONLOOK_DISPLAY_NAME_NOTE_REF} add -f -m ${escapedDisplayName} ${commitOid}`,
215215
);
216216
}
217217

@@ -221,7 +221,7 @@ export class GitManager {
221221
async getCommitNote(commitOid: string): Promise<string | null> {
222222
try {
223223
const result = await this.runCommand(
224-
`git notes --ref=${ONLOOK_DISPLAY_NAME_NOTE_REF} show ${commitOid}`,
224+
`git --no-pager notes --ref=${ONLOOK_DISPLAY_NAME_NOTE_REF} show ${commitOid}`,
225225
true,
226226
);
227227
if (result.success && result.output) {

0 commit comments

Comments
 (0)