summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/auto-changelog2
-rwxr-xr-xbin/pre-generate19
2 files changed, 18 insertions, 3 deletions
diff --git a/bin/auto-changelog b/bin/auto-changelog
index 2b8187f..64d15e9 100755
--- a/bin/auto-changelog
+++ b/bin/auto-changelog
@@ -39,7 +39,7 @@ main() {
if should-insert; then
insert
git add src/changelog.md
- git commit -m 'Auto-insert entry to ChangeLog'
+ git commit -m 'Auto-insert entry to ChangeLog' --author='Logger <logger@andrewdm.me>'
fi
}
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"