Merge ~cjwatson/launchpad:old-git-compatibility into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 4378677840cf90dba3db65b6bc6cf8c2276f9f5e
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:old-git-compatibility
Merge into: launchpad:master
Diff against target: 16 lines (+4/-1)
1 file modified
Makefile (+4/-1)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+440779@code.launchpad.net

Commit message

Restore compatibility with xenial's git

Description of the change

Calling `git branch --show-current` from the `Makefile` produces ugly warnings on xenial systems. I don't _think_ it causes a hard failure except when publishing deployment artifacts to Swift (which we only do on focal anyway), but better safe than sorry.

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) wrote :

I have one alternative approach, which does not involve `sed`.

review: Approve
4378677... by Colin Watson

git simplification from Jürgen

Revision history for this message
Colin Watson (cjwatson) :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Makefile b/Makefile
2index f60189b..ebacd51 100644
3--- a/Makefile
4+++ b/Makefile
5@@ -88,7 +88,10 @@ PIP_BIN = \
6
7 # Create archives in labelled directories (e.g.
8 # <rev-id>/$(PROJECT_NAME).tar.gz)
9-GIT_BRANCH := $(shell git branch --show-current)
10+# XXX cjwatson 2023-04-11: Should be "git branch --show-current", but
11+# xenial's git doesn't support that. Use the more concise form once we
12+# require focal.
13+GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
14 TARBALL_REVISION ?= $(shell git rev-parse HEAD)
15 ifeq ($(GIT_BRANCH),db-devel)
16 TARBALL_SUFFIX := db

Subscribers

People subscribed via source and target branches

to status/vote changes: