I have a Git repository originally imported from Subversion. Parts of the author / committer information are incorrect, which is not a Git error, but mainly due to a sloppy commit with Subversion.
I would like to use git filter-branchto rewrite the history of the repository, to capture the data of the committer and the author.
git filter-branch
The problem is ... I need to wrest author information from commit messages. As far as I can tell, git filter-branchit allows filtering and changing information about the author (using --env-filter) and / or filtering on commit messages (using --msg-filter), but they do n’t do both at the same time, with information shared between different filters.
--env-filter
--msg-filter
So I'm a little fixated on how to do this ... the best I can think of is to do it in a few passes: first, collect allllll commit messages, and then make a script to go through and filter all the information About the author / committer. This seems rather inelegant and error prone, so I wonder if anyone else could think about making this work more smoothly.
, , , - . , stdin, , . git commit-tree . ( commit, .)
git commit-tree
bash :
message=$(read_from_stdin) modify_env_vars "$message" echo "$message" | git commit-tree "$@"
, , , !
( - , --env-filter --msg-filter , , . , , , , , , .)