git-filter-repo/t/t9391/rename-master-to-develop.py
Elijah Newren ef4b96e7be filter-repo: add API backward compatibility warning
Signed-off-by: Elijah Newren <newren@gmail.com>
2019-04-29 09:56:38 -07:00

24 lines
681 B
Python
Executable File

#!/usr/bin/env python
"""
Please see the
***** API BACKWARD COMPATIBILITY CAVEAT *****
near the top of git-filter-repo.
Also, note that splicing repos may need some special care as fast-export
only shows the files that changed relative to the first parent, so there
may be gotchas if you are to splice near merge commits; this example does
not try to handle any such special cases.
"""
import git_filter_repo as fr
def my_commit_callback(commit):
if commit.branch == "refs/heads/master":
commit.branch = "refs/heads/develop"
args = fr.FilteringOptions.default_options()
args.force = True
filter = fr.RepoFilter(args, commit_callback = my_commit_callback)
filter.run()