2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-04-01 15:02:49 +01:00

Add commit msg when on a devserver

This commit is contained in:
2024-12-29 15:49:07 +00:00
parent 6d2484376a
commit ace2325773
4 changed files with 16 additions and 12 deletions

View File

@@ -5,6 +5,7 @@ import os
import random
import re
import resource
import socket
import string
import subprocess
from datetime import datetime, timezone
@@ -45,6 +46,8 @@ sha = hashlib.new('sha256')
COOKIE_MAX_AGE = 12*60*60 # seconds
throw = 35.0
EXPOSERVER = "expo" # hostname of the server at expo.survex.com
DEV_OK = """On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
@@ -260,7 +263,12 @@ def git_commit(cwd, message, editor, commands=[]):
"""
git = settings.GIT
print(f"git commit in {cwd}")
print(f"Committing:\n{message=}\n{editor=}")
if socket.gethostname() != EXPOSERVER:
message += f" on dev machine '{socket.gethostname()}'"
elif settings.DEVSERVER:
message += " on a dev machine using 'runserver'"
print(f"..{message=}\n..{editor=}")
cmd_commit = [git, "commit", "-m", message, "--author", f"{editor}"]
commands.append(cmd_commit)