]> Lady’s Gitweb - Status/commitdiff
Add Makefile rule for updating upstream
authorLady <redacted>
Fri, 15 Dec 2023 04:59:44 +0000 (23:59 -0500)
committerLady <redacted>
Sat, 23 Dec 2023 20:27:36 +0000 (15:27 -0500)
This keeps upstream `x_status_git` changes squashed into the first
commit and rebases all remaining commits onto it.

Makefile

index aeb91ace9b1fdc97ed854ede6a630c815e247e99..7e6dbb47897daed18d09820b243abd4932c1fcb2 100644 (file)
--- 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 ;
This page took 0.021203 seconds and 4 git commands to generate.