rtyley / bfg-repo-cleaner

Removes large or troublesome blobs like git-filter-branch does, but faster. And written in Scala
https://rtyley.github.io/bfg-repo-cleaner/
GNU General Public License v3.0
10.83k stars 535 forks source link

Problem Replacing Text in Binary Files (or files with few line-feeds) #461

Open phreed opened 2 years ago

phreed commented 2 years ago

This is related to PR #168 The #168, multi-line regex solution, could cause problems when opening large files.

This problem exists even without multi-line regex.

Suppose, a large file is present which contains no 'newline' characters? Then a line is the whole file. This problem can be addressed, see https://gitlab.com/babeloff/bbex, by chunking the file into appropriate blocks. In the default case, the blocks are delimited by 'newline' characters. If you are interested I could probably write a PR to address this (very rare) bug.

It would provide the multi-line regex feature as a side-effect.