From 4a280c629fca886547eb0f4ebbe6319b75b240d7 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 27 Aug 2023 17:57:30 +0100 Subject: .gitcheck: re-write entirely. force global config. the way the old script worked was extremely hacky it's cleaner just to make the user configure git i haven't used anything from the old .gitcheck script, which is now deleted. i completely re-wrote this, in a much simpler way. this is less maintenance now, when things change in the upstream projects. coreboot makes heavy use of git within its build system Signed-off-by: Leah Rowe --- checkgit | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 checkgit (limited to 'checkgit') diff --git a/checkgit b/checkgit new file mode 100755 index 00000000..eb97dcae --- /dev/null +++ b/checkgit @@ -0,0 +1,27 @@ +#!/usr/bin/env sh +# SPDX-FileCopyrightText: 2023 Leah Rowe +# SPDX-License-Identifier: MIT + +. "include/err.sh" + +projectname="$(cat projectname)" + +main() +{ + which git 1>/dev/null 2>/dev/null || \ + fail "git not installed. please install git-scm." + git config --global user.name 1>/dev/null 2>/dev/null || \ + fail "git config --global user.name \"John Doe\"" + git config --global user.email 1>/dev/null 2>/dev/null || \ + fail "git config --global user.email \"john.doe@example.com\"" +} + +fail() +{ + printf "You must configure Git, before using %s's build system. Do:\n" \ + "${projectname}" 1>&2 + printf "%s\n\n" "${1}" + err "Misconfigured git-scm" +} + +main $@ -- cgit v1.2.1