We have a fairly large codebase comprising of about 60000 commits. We want to reformat all our .java files while preserving the git history. So, the approach we took is to use git filter-branch --tree-filter to reformat the entire codebase while keeping the history intact. But, there are a few questions that I am unable to find an answer.

1. When I apply a --tree-filter and pass the command that reformats all the .java files in the root directory, the rewrite happens, but at the very end, I see all the .java files in the staging area. Is a commit needed at every step of the rewrite or does it happen automatically?
2. git filter-branch seems to take a range of commits and so that made me wonder if it is possible to save the commit ID before every rewrite and resume in case of a failure. Resumption is important as the whole process might take a few days to complete (even on a powerful compute instance).
3. For the purpose of reformatting the entire codebase, would --index-filter work?

**UPDATE: Clarifications**

* The code base is about 2.2 million lines of Java code. Not doing a git rewrite would cause approximately 10%-12% of the codebase to be attributed to the wrong author. That's about 200K lines of java code which is something we wanted to avoid. Git rewrite makes it look like the person who made a change did it the right way.