I have a repo with some automation that’s failed badly. The automation should retrieve a file from the git repo, append “a record,” which is multiple lines, push up a new branch, open a pull/merge request for that branch to be merged to the default, and then automatically merge after a successful CI run. Failure in that last step has left me with 50 open, conflicting MRs.
Essentially, each branch’s changes are to a single file, simply appending data to it. So, each of the branches’ changes are in conflict with each other: git merge $(git branch --remote | grep ${BRANCH_PREFIX})
using the octopus merge strategy fails. I could merge them one at a time in chronological order, a task I’ve undertaken when I’ve had a handful of failures but resolving 50 is an afternoon instead of a cup of coffee.
Ideally, I’m looking for the best way to effectively end up with the contents of the change of each branch appended in chronological order. The branch name has a timestamp in it, if that helps more than a commit timestamp. There’s not really a record separator per say: it’s a text format but the processing tool doesn’t really have a “get last” that’d be meaningful to iterate through the branches and call the tool to get the last record and then dump it in a file.
I’d like to preserve the git history, but I’m OK with losing it, too.
1