X-Git-Url: https://git.ladys.computer/Status/blobdiff_plain/78d46700499c5245773cb0ce09f304ffd17fdd1b..0a3cbe4e36663d7fb9784008e370a2ef3c5db289:/Makefile

diff --git a/Makefile b/Makefile
index aeb91ac..7e6dbb4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,28 @@
+X_STATUS_GIT = https://git.ladys.computer/x_status_git.git
+
+update: FIRST_COMMIT = $(shell git rev-list --max-parents=0 live)
+
 nothing:
 	@echo 'Type `make remote` to update the remote post-receive script.'
 
+update:
+	git remote add upstream $(X_STATUS_GIT)
+	git fetch upstream
+	git checkout --detach upstream/current
+	git reset --soft $(FIRST_COMMIT)
+	git commit --amend --no-edit
+	git tag base
+	git checkout live
+	git rebase --onto base $(FIRST_COMMIT)
+	git tag --delete base
+	git remote remove upstream
+
+clean:
+	git remote remove upstream || true
+	git tag --delete base || true
+	git checkout live
+
 remote:
 	scp post-receive computer:/srv/git/Status/hooks/post-receive
 
-.PHONY: nothing remote ;
+.PHONY: nothing remote update clean ;