The tagging targets in base.mk hardcode the origin remote instead of using a configurable variable. This is a problem for any maintainer whose clone has origin pointing at a personal fork with the canonical repo configured under a different remote name (e.g. upstream). In that setup, make tag / make rmtag / make forcetag create and delete the release tag on the fork rather than the canonical repo, so a release re-tag silently lands on the wrong remote and has to be redone by hand against the correct remote.
This surfaced concretely while re-pointing the cat_tools 0.2.3 release tag: the maintainer's origin was their fork, with the canonical Postgres-Extensions/cat_tools repo configured as a separate remote, and make forcetag moved the tag on the fork instead of upstream.
All three hardcoded occurrences are in base.mk, all in the tagging section:
base.mk:442 (rmtag target) — git fetch origin # Update our remotes
base.mk:444 (rmtag target) — @test -z "$$(git ls-remote --tags origin $(PGXNVERSION) | grep -v '{}')" || git push --delete origin $(PGXNVERSION)
base.mk:459 (tag target) — git push origin $(PGXNVERSION)
forcetag (base.mk:462) is just rmtag tag, so it inherits both issues transitively. dist (base.mk:465) depends on tag and therefore also inherits it. dist-only (base.mk:467) and the pgxntool-sync* targets do not hardcode a remote — pgxntool-sync.sh already takes the repo/ref as explicit arguments (see pgxntool-sync-master, pgxntool-sync-local, etc. in base.mk), so those are unaffected.
Proposed fix
Introduce a variable, e.g.:
and use $(PGXN_REMOTE) in place of the literal origin at all three call sites above. Default stays origin for backward compatibility, but a maintainer in the fork+upstream situation can run e.g. make forcetag PGXN_REMOTE=upstream to target the correct remote.
Worth double-checking whether any other targets added after this issue is filed also assume origin — the tagging block above is the only place currently found via a full grep of base.mk and the embedded .sh scripts for origin, git push, git fetch, git ls-remote, and git pull.
The tagging targets in
base.mkhardcode theoriginremote instead of using a configurable variable. This is a problem for any maintainer whose clone hasoriginpointing at a personal fork with the canonical repo configured under a different remote name (e.g.upstream). In that setup,make tag/make rmtag/make forcetagcreate and delete the release tag on the fork rather than the canonical repo, so a release re-tag silently lands on the wrong remote and has to be redone by hand against the correct remote.This surfaced concretely while re-pointing the cat_tools 0.2.3 release tag: the maintainer's
originwas their fork, with the canonicalPostgres-Extensions/cat_toolsrepo configured as a separate remote, andmake forcetagmoved the tag on the fork instead of upstream.All three hardcoded occurrences are in
base.mk, all in the tagging section:base.mk:442(rmtagtarget) —git fetch origin # Update our remotesbase.mk:444(rmtagtarget) —@test -z "$$(git ls-remote --tags origin $(PGXNVERSION) | grep -v '{}')" || git push --delete origin $(PGXNVERSION)base.mk:459(tagtarget) —git push origin $(PGXNVERSION)forcetag(base.mk:462) is justrmtag tag, so it inherits both issues transitively.dist(base.mk:465) depends ontagand therefore also inherits it.dist-only(base.mk:467) and thepgxntool-sync*targets do not hardcode a remote —pgxntool-sync.shalready takes the repo/ref as explicit arguments (seepgxntool-sync-master,pgxntool-sync-local, etc. inbase.mk), so those are unaffected.Proposed fix
Introduce a variable, e.g.:
PGXN_REMOTE ?= originand use
$(PGXN_REMOTE)in place of the literaloriginat all three call sites above. Default staysoriginfor backward compatibility, but a maintainer in the fork+upstream situation can run e.g.make forcetag PGXN_REMOTE=upstreamto target the correct remote.Worth double-checking whether any other targets added after this issue is filed also assume
origin— the tagging block above is the only place currently found via a full grep ofbase.mkand the embedded.shscripts fororigin,git push,git fetch,git ls-remote, andgit pull.