git filter-branch --env-filter \'
export GIT_AUTHOR_EMAIL=\"foo@example.com\"
export GIT_AUTHOR_NAME=\"foo\"\' -- commita..commitb
Results in
I do it this way.
Let's say you want to filter the content of a branch called branch-you-are-filtering.
Assume that there's an ancestor commit to that branch, with a ref called ref-for-commit-to-stop-at.
git filter-branch --commit-filter 'YOUR_FILTER_COMMANDS' branch-you-are-filtering...ref-for-commit-to-stop-at
After executing, the commit at ref-for-commit-to-stop-at will not be altered. All the filtered\changed commits in branch branch-you-are-filtering will be based on ref-for-commit-to-stop-at.
Whether or not you're using --commit-filter or something else is up to you.