Stage half of 500 hunks in a 50k-line file: grit add --hunks vs git diff (same path) + first-half hunk select + git apply --cached
repo: synth-10k extended by one committed 50k-line large.txt, modified into 500 hunks; file/commit counts derived from recounted base plus that setup step · 10,001 files · 1,001 commits · 800 refs
| tool | median | min | max | runs | peak memory |
|---|---|---|---|---|---|
| git | 12 ms | 12 ms | 27 ms | 20 | 10 MB |
| grit | 22 ms | 21 ms | 43 ms | 20 | 27 MB |
$ git apply --cached /tmp/grit-bench-scratch/daily-synth-10k/hunks-half.patch
$ H=$(cat '/tmp/grit-bench-scratch/daily-synth-10k/hunks-half.ids') && grit add --hunks "$H" -- large.txt