| ... | @@ -59,6 +59,10 @@ const RANGE_DIFF_SUMMARY_MAX_OUTPUT_BYTES = 19_000; | ... | @@ -59,6 +59,10 @@ const RANGE_DIFF_SUMMARY_MAX_OUTPUT_BYTES = 19_000; |
| 59 | const RANGE_DIFF_PATCH_MAX_OUTPUT_BYTES = 59_000; | 59 | const RANGE_DIFF_PATCH_MAX_OUTPUT_BYTES = 59_000; |
| 60 | const REVIEW_DIFF_PATCH_MAX_OUTPUT_BYTES = 120_000; | 60 | const REVIEW_DIFF_PATCH_MAX_OUTPUT_BYTES = 120_000; |
| 61 | const REVIEW_METADATA_MAX_OUTPUT_BYTES = 16 * 1024 * 1024; | 61 | const REVIEW_METADATA_MAX_OUTPUT_BYTES = 16 * 1024 * 1024; |
| | 62 | // Every status refresh adds the untracked files to a temporary index, and git add's cost grows |
| | 63 | // much faster than the file count (50k files took about 30 seconds). Past this many, the |
| | 64 | // totals are reported incomplete instead. |
| | 65 | const REVIEW_UNTRACKED_MAX_FILES = 5_000; |
| 62 | const REVIEW_DIFF_FILE_MAX_OUTPUT_BYTES = 1024 * 1024; | 66 | const REVIEW_DIFF_FILE_MAX_OUTPUT_BYTES = 1024 * 1024; |
| 63 | // Patches the clients render are parsed against git's default a/ and b/ path | 67 | // Patches the clients render are parsed against git's default a/ and b/ path |
| 64 | // prefixes. A repository or global diff.noprefix or diff.mnemonicPrefix would | 68 | // prefixes. A repository or global diff.noprefix or diff.mnemonicPrefix would |
| ... | @@ -2618,7 +2622,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* | ... | @@ -2618,7 +2622,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* |
| 2618 | }); | 2622 | }); |
| 2619 | | 2623 | |
| 2620 | // Lists untracked files and adds them to a temporary index, so a diff against any commit | 2624 | // Lists untracked files and adds them to a temporary index, so a diff against any commit |
| 2621 | // shows them as new. Returns null when the list is too big to read. Needs a Scope. | 2625 | // shows them as new. Returns null when the list is too big to read or to index. Needs a Scope. |
| 2622 | const prepareUntrackedReviewIndex = Effect.fn("prepareUntrackedReviewIndex")(function* ( | 2626 | const prepareUntrackedReviewIndex = Effect.fn("prepareUntrackedReviewIndex")(function* ( |
| 2623 | cwd: string, | 2627 | cwd: string, |
| 2624 | pathArgs: ReadonlyArray<string>, | 2628 | pathArgs: ReadonlyArray<string>, |
| ... | @@ -2640,6 +2644,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* | ... | @@ -2640,6 +2644,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* |
| 2640 | (candidate) => onlyPath === undefined || candidate === onlyPath, | 2644 | (candidate) => onlyPath === undefined || candidate === onlyPath, |
| 2641 | ); | 2645 | ); |
| 2642 | if (paths.length === 0) return { env: undefined }; | 2646 | if (paths.length === 0) return { env: undefined }; |
| | 2647 | if (paths.length > REVIEW_UNTRACKED_MAX_FILES) return null; |
| 2643 | const env = yield* prepareReviewIndex(cwd, paths).pipe( | 2648 | const env = yield* prepareReviewIndex(cwd, paths).pipe( |
| 2644 | Effect.catchTags({ | 2649 | Effect.catchTags({ |
| 2645 | PlatformError: (cause) => | 2650 | PlatformError: (cause) => |