docs(diff): say that files over the one-file cap take no line comment
- commit
- de918e26676ba21609d469826188eae32c7509f1
- author
- brice · · 2026-10-20 08:19 UTC
- committer
- brice · · 2026-10-20 09:16 UTC
- parent
- 4af5505
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +5 -4
M docs/merge-requests.md +1 -1
| @@ -67,7 +67,7 @@ In the web merge box a mode that is not possible is disabled with its reason, an | |||
| 67 | 67 | ||
| 68 | 68 | The merge request, commit and compare pages list every changed file. Generated files (lockfiles, `vendor/`, `node_modules/`, minified or generated code) and large files (over 2,000 changed lines) are collapsed: the header and the counts show, the lines do not. "load diff" fetches that one file in place, in full, and you can comment on its lines. Without scripts the link reloads the page with that file loaded. After the first 25 files of a merge request, the other files load as you scroll. | |
| 69 | 69 | ||
| 70 | - | A commit page reads the hunks of its first 300 files with the page; the other files are listed collapsed and load one at a time. A file that cannot be shown in the browser, over 8 MiB of text or over 50,000 changed lines when loaded alone, has no "load diff": the page links to its raw blob instead. | |
| 70 | + | A commit page reads the hunks of its first 300 files with the page; the other files are listed collapsed and load one at a time. A file that cannot be shown in the browser, over 8 MiB of text or over 50,000 changed lines when loaded alone, has no "load diff": the page links to its raw blob instead, and its lines take no comment. | |
| 71 | 71 | ||
| 72 | 72 | ## Notes | |
| 73 | 73 | ||
| @@ -67,7 +67,7 @@ In the web merge box a mode that is not possible is disabled with its reason, an | |||||
| 67 | 67 | ||||
| 68 | The merge request, commit and compare pages list every changed file. Generated files (lockfiles, `vendor/`, `node_modules/`, minified or generated code) and large files (over 2,000 changed lines) are collapsed: the header and the counts show, the lines do not. "load diff" fetches that one file in place, in full, and you can comment on its lines. Without scripts the link reloads the page with that file loaded. After the first 25 files of a merge request, the other files load as you scroll. | 68 | The merge request, commit and compare pages list every changed file. Generated files (lockfiles, `vendor/`, `node_modules/`, minified or generated code) and large files (over 2,000 changed lines) are collapsed: the header and the counts show, the lines do not. "load diff" fetches that one file in place, in full, and you can comment on its lines. Without scripts the link reloads the page with that file loaded. After the first 25 files of a merge request, the other files load as you scroll. | ||
| 69 | 69 | ||||
| 70 | - | A commit page reads the hunks of its first 300 files with the page; the other files are listed collapsed and load one at a time. A file that cannot be shown in the browser, over 8 MiB of text or over 50,000 changed lines when loaded alone, has no "load diff": the page links to its raw blob instead. | 70 | + | A commit page reads the hunks of its first 300 files with the page; the other files are listed collapsed and load one at a time. A file that cannot be shown in the browser, over 8 MiB of text or over 50,000 changed lines when loaded alone, has no "load diff": the page links to its raw blob instead, and its lines take no comment. |
| 71 | 71 | ||||
| 72 | ## Notes | 72 | ## Notes | ||
| 73 | 73 | ||||
M internal/usecase/mergerequests.go +4 -3
| @@ -780,9 +780,10 @@ func (m *MergeRequests) checkLine(ctx context.Context, mr domain.MergeRequest, p | |||
| 780 | 780 | // file's hunks within the default total limits would reject a comment on a | |
| 781 | 781 | // file the earlier ones left no budget for. So a first read lists the files | |
| 782 | 782 | // with no hunks (From past the end: cheap, git is stopped at once), and a | |
| 783 | - | // second loads the one file in full (a Full window: no line cap, the byte | |
| 784 | - | // guard only, generated files included), as the web view does when it loads | |
| 785 | - | // a collapsed file: any line the page can show can be commented on. | |
| 783 | + | // second loads the one file in full (a Full window: the byte guard and | |
| 784 | + | // domain.MaxOneFileLines only, generated files included), as the web view | |
| 785 | + | // does when it loads a collapsed file: any line the page can show can be | |
| 786 | + | // commented on, and a file over those limits takes no line comment. | |
| 786 | 787 | list := domain.DefaultDiffLimits() | |
| 787 | 788 | list.MaxFiles, list.From = 0, math.MaxInt | |
| 788 | 789 | _, diff, err := m.git.DiffCommits(ctx, mr.Repo, base, mr.HeadID, list) | |
| @@ -780,9 +780,10 @@ func (m *MergeRequests) checkLine(ctx context.Context, mr domain.MergeRequest, p | |||||
| 780 | // file's hunks within the default total limits would reject a comment on a | 780 | // file's hunks within the default total limits would reject a comment on a | ||
| 781 | // file the earlier ones left no budget for. So a first read lists the files | 781 | // file the earlier ones left no budget for. So a first read lists the files | ||
| 782 | // with no hunks (From past the end: cheap, git is stopped at once), and a | 782 | // with no hunks (From past the end: cheap, git is stopped at once), and a | ||
| 783 | - | // second loads the one file in full (a Full window: no line cap, the byte | 783 | + | // second loads the one file in full (a Full window: the byte guard and |
| 784 | - | // guard only, generated files included), as the web view does when it loads | 784 | + | // domain.MaxOneFileLines only, generated files included), as the web view |
| 785 | - | // a collapsed file: any line the page can show can be commented on. | 785 | + | // does when it loads a collapsed file: any line the page can show can be |
| 786 | + | // commented on, and a file over those limits takes no line comment. | |||
| 786 | list := domain.DefaultDiffLimits() | 787 | list := domain.DefaultDiffLimits() | ||
| 787 | list.MaxFiles, list.From = 0, math.MaxInt | 788 | list.MaxFiles, list.From = 0, math.MaxInt | ||
| 788 | _, diff, err := m.git.DiffCommits(ctx, mr.Repo, base, mr.HeadID, list) | 789 | _, diff, err := m.git.DiffCommits(ctx, mr.Repo, base, mr.HeadID, list) | ||