lite icon indicating copy to clipboard operation
lite copied to clipboard

Capability to split many-to-many mono-folders-to-branches

Open crossan007 opened this issue 4 years ago • 0 comments

I've got a monorepo with hundreds of standalone project-root folders which I'm converting to an equal number of individual branches (each branch representing the root of each standalone project currently in the monorepo)

Currently, my "best approach" is running subtree split in parallel: specifying each folder in the root of the monorepo and the corresponding branch name. e.g.:

for d in *; do
    # Will print */ if no directories are available
    #echo $d
    git subtree split -P "$d" -b "$d" &
done

The issue with this approach is that it pegs the CPU for approximately 8 hours and is woefully inefficient.

I would like to be able to run one instance of subtree split in a manner that is capable of multiple target branches for each commit it parses (dependent on the paths affected by each commit): rather than multiple instances of subtree split each focusing on it's own path pattern.

One possible idea would be to allow RegEx parsing of the pattern with capture groups; and allow use of the RegEx capture group value within the target branch name.

crossan007 avatar Mar 06 '20 14:03 crossan007