Compare commits
No commits in common. "168dbfe770c30c3ef88bf9d15ebc95e4c9c1ef65" and "b045babff43f13ff100b6f0cbf853fa9e039d7d4" have entirely different histories.
168dbfe770
...
b045babff4
@ -6,41 +6,6 @@ xgit() {
|
|||||||
git -c "user.name=Flake Update Bot" -c "user.email=flake-update-bot@clerie.de" -c "core.pager=cat" "$@"
|
git -c "user.name=Flake Update Bot" -c "user.email=flake-update-bot@clerie.de" -c "core.pager=cat" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
xgit_merge_theirs() {
|
|
||||||
# base branch is the one currently checked out
|
|
||||||
|
|
||||||
# this is the branch we want to merge into the base branch
|
|
||||||
OTHER_BRANCH="$1"
|
|
||||||
|
|
||||||
# merge commit message
|
|
||||||
COMMIT_MESSAGE="$2"
|
|
||||||
|
|
||||||
# this branch gets used while merging
|
|
||||||
TEMP_BRANCH="tempbranch"
|
|
||||||
|
|
||||||
# create a merge commit between base branch and other branch, so it shows up correctly in git log
|
|
||||||
# we use `ours` so we make sure there are no merge conflicts
|
|
||||||
git merge -s ours "${OTHER_BRANCH}" -m "${COMMIT_MESSAGE}"
|
|
||||||
|
|
||||||
# save our newly created merge commit in a seperate branch
|
|
||||||
git branch "${TEMP_BRANCH}"
|
|
||||||
|
|
||||||
# export contents of other branch to current working directory
|
|
||||||
# this will change the last commit of our base branch too
|
|
||||||
git reset --hard "${OTHER_BRANCH}"
|
|
||||||
|
|
||||||
# return to our merge commit from the base branch
|
|
||||||
# but without touching the current working directory
|
|
||||||
git reset --soft "${TEMP_BRANCH}"
|
|
||||||
|
|
||||||
# Add the changes to our merge commit
|
|
||||||
git commit --amend --no-edit
|
|
||||||
|
|
||||||
# we are now on our base branch again
|
|
||||||
# so we can delete the temp branch
|
|
||||||
git branch -D "${TEMP_BRANCH}"
|
|
||||||
}
|
|
||||||
|
|
||||||
NOW="$(date --utc +%Y-%m-%d-%H-%M)"
|
NOW="$(date --utc +%Y-%m-%d-%H-%M)"
|
||||||
|
|
||||||
xgit status || xgit clone gitea@git.clerie.de:clerie/nixfiles.git .
|
xgit status || xgit clone gitea@git.clerie.de:clerie/nixfiles.git .
|
||||||
@ -78,7 +43,7 @@ xgit push --set-upstream origin "${UPDATE_BRANCH}"
|
|||||||
|
|
||||||
echo "[!] Merge ${UPDATE_BRANCH} into updated-inputs"
|
echo "[!] Merge ${UPDATE_BRANCH} into updated-inputs"
|
||||||
xgit checkout updated-inputs
|
xgit checkout updated-inputs
|
||||||
xgit_merge_theirs "${UPDATE_BRANCH}" "Update from ${UPDATE_BRANCH}"
|
xgit merge -s ort -X theirs "${UPDATE_BRANCH}" -m "Update from ${UPDATE_BRANCH}"
|
||||||
|
|
||||||
echo "[!] Publish updated-inputs"
|
echo "[!] Publish updated-inputs"
|
||||||
xgit push origin updated-inputs
|
xgit push origin updated-inputs
|
||||||
|
Loading…
Reference in New Issue
Block a user