From 6e8615569699b3a5fbd8664c66f42953fff15995 Mon Sep 17 00:00:00 2001 From: Dimitri Merejkowsky Date: Wed, 12 May 2021 13:50:02 +0200 Subject: [PATCH] Makefile: don't run `git checkout` on behalf of the user I know this is safe because we check the repo is clean, but don't like code I run on a repo to change the git state of an other repo nearby. Maybe that's just me, though --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d087c51f6..26ede950b 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,13 @@ endif .PHONY: all all: ensure_prerequisites - git -C $(CPYTHON_PATH) checkout $(CPYTHON_CURRENT_COMMIT) + @if [ $(shell git -C $(CPYTHON_PATH) rev-parse HEAD) != $(CPYTHON_CURRENT_COMMIT) ]; then \ + echo "Your $(CPYTHON_PATH) repositoy is not at the currect revision"; \ + echo "You can run try and run "; \ + echo "git -C $(CPYTHON_PATH) checkout $(CPYTHON_CURRENT_COMMIT)"; \ + echo "to fix the problem"; \ + exit 1; \ + fi mkdir -p locales/$(LANGUAGE)/LC_MESSAGES/ $(CP_CMD) -u --parents *.po */*.po locales/$(LANGUAGE)/LC_MESSAGES/ $(MAKE) -C $(CPYTHON_PATH)/Doc/ \