[Libreoffice] OneGit migration. Review needed of clean_spaces tool

Norbert Thiebaud nthiebaud at gmail.com
Tue May 31 19:58:47 PDT 2011

Taking advantage of the OneGit migration process, we are going to
clean-up tabs and spaces in the whole history (hence keeping git-blame

In order to do that, the repository are going through a git
filter-branch process, typically something like

git filter-branch --prune-empty --tag-name-filter cat --tree-filter
'git ls-files | clean_spaces -p 1 ' -- --all

clean_spaces goal is to replace tab with the appropriate number of
spaces (based on a 4 spaces indentation), and to eliminate trailing

It is very critical that that tool be bug free. any bug could screw-up
the history in subtitle or not subtitle ways. if this is not caught
before the migration is done
it could make fixing these problem very very hard...

So, I call for as many pair of eyes as possible to make sure that the
code of clean_spaces is sane.




Note: yes, there are leaks and hard coded buffer. They should be
signaled as such in the source. This is not meant to be an all-purpose
fool-proof tool, but it is meant to work as efficiently as possible
within the constraint of the migration at hand.

PS: Yes it is in C, and no, perl/bash/python/C++ are not an option.
bear in mind that libs-core, for instance, as 68400+ commit to be
processed, each commit is 8000+ files to be analyzed and 80MB of data
to be parsed counting only cxx and hxx files.

More information about the LibreOffice mailing list