RFE - multi-pass filter invocations
Author: cipherboyCreated Jun 26, 2026Updated Jul 12, 2026
Sometimes creating the ideal split history requires multiple passes. It'd be great to have a multi-step split, subject to constraint that all refs are treated relative to the original source repo.
E.g., something like:
git filter-repo \
--path a/b/c \
--path-rename a/b/c:c \
--path a/b/d \
--path-rename a/b/d:d \
--source ./openbao --target ./openbao-plugins \
---- \
--message-callback 'return re.sub(b"#([0-9]+)", b"source/repo#\\1", message)' \
--refs ${INITIAL}...${FORK_POINT} \
---- \
--message-callback 'return re.sub(b"#([0-9]+)", b"fork/repo#\\1", message)' \
--refs ${FORK_COMMIT}...HEAD \
--- \
--message-callback 'return message.replace(b"\n", b" (#ISSUE)\n", 1)' \Explained, this'd:
- Filter all commits by path into the destination.
- Update the message of select filtered commits with the source repo reference.
- Update the message of remaining filtered commits with the fork repo reference.
- Update all filtered commits with the issue number of the change.
All with a single command.
Source: newren/git-filter-repo