diff options
Diffstat (limited to 'bin/pre-generate')
-rwxr-xr-x | bin/pre-generate | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/bin/pre-generate b/bin/pre-generate index e5f8f5e..c2d3516 100755 --- a/bin/pre-generate +++ b/bin/pre-generate @@ -13,23 +13,38 @@ if [[ $branch == master ]]; then git worktree prune git branch -D pre-generated.tmp &>/dev/null || true + unset GIT_INDEX_FILE git worktree add -b pre-generated.tmp "${gitdir}/pre-generated" master ( unset GIT_DIR GIT_WORK_TREE cd "$workdir" + msg="$(git log -n1 master --pretty=format:%B)" + export GIT_AUTHOR_NAME='Maker' + export GIT_AUTHOR_EMAIL='maker@andrewdm.me' make -j1 echo '!/out/' >> .gitignore git add . git commit -m "make: $msg" - git checkout pre-generated + + git checkout pre-generated # Ensure it exists locally + git pull --no-edit -s ours # Avoid conflicts + + # What we want is + # + # git merge --no-edit -s theirs pre-generated.tmp + # + # Unfortunately, there is no 'theirs' strategy; so we + # have to switch branches and do it backward with the + # 'ours' strategry, switch back, then merge the merge + # commit. git checkout pre-generated.tmp git merge --no-edit -s ours pre-generated git checkout pre-generated - git pull git merge pre-generated.tmp + git branch -d pre-generated.tmp ) rm -rf -- "$workdir" |