commit:     fb9a4c2672aa1d0177e47409f8fa45c8bafdd92a
Author:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
AuthorDate: Tue Nov  4 20:50:48 2025 +0000
Commit:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
CommitDate: Tue Nov  4 20:52:23 2025 +0000
URL:        
https://gitweb.gentoo.org/proj/dotnet/gentoo-dotnet-maintainer-tools.git/commit/?id=fb9a4c26

chore: add authoring

Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org>

 code/authoring/generate_changelog.sh | 22 ++++++++++++++++++++++
 code/authoring/git_scrub.sh          | 18 ++++++++++++++++++
 code/authoring/install_hooks.sh      | 14 ++++++++++++++
 code/authoring/run_pre_commit.sh     | 17 +++++++++++++++++
 code/authoring/run_tbump.sh          | 33 +++++++++++++++++++++++++++++++++
 code/authoring/setup_user.sh         | 24 ++++++++++++++++++++++++
 6 files changed, 128 insertions(+)

diff --git a/code/authoring/generate_changelog.sh 
b/code/authoring/generate_changelog.sh
new file mode 100755
index 0000000..865de4e
--- /dev/null
+++ b/code/authoring/generate_changelog.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# Copyright 2023-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+trap "exit 130" INT
+set -eu
+
+script_path="${0}"
+script_root="$(dirname "${script_path}")"
+
+repo_root="$(realpath "${script_root}/../..")"
+cd "${repo_root}"
+
+if ! command -v cz >/dev/null ; then
+    printf "Commitizen executable not found, exiting!" >> /dev/stderr
+    exit 1
+fi
+
+set -x
+cz ch
+git add CHANGELOG.md

diff --git a/code/authoring/git_scrub.sh b/code/authoring/git_scrub.sh
new file mode 100755
index 0000000..637a176
--- /dev/null
+++ b/code/authoring/git_scrub.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Copyright 2023-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+trap "exit 130" INT
+set -eu
+
+script_path="${0}"
+script_root="$(dirname "${script_path}")"
+
+repo_root="$(realpath "${script_root}/../..")"
+cd "${repo_root}"
+
+set -x
+
+git gc --aggressive
+git fsck --full

diff --git a/code/authoring/install_hooks.sh b/code/authoring/install_hooks.sh
new file mode 100755
index 0000000..ad1a150
--- /dev/null
+++ b/code/authoring/install_hooks.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Copyright 2023-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+trap "exit 130" INT
+set -eu
+
+set -x
+
+pre-commit install --install-hooks
+pre-commit install --hook-type commit-msg
+
+git config --local commit.template .gitmessage

diff --git a/code/authoring/run_pre_commit.sh b/code/authoring/run_pre_commit.sh
new file mode 100755
index 0000000..cda9ff2
--- /dev/null
+++ b/code/authoring/run_pre_commit.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Copyright 2023-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+trap "exit 130" INT
+set -eu
+
+script_path="${0}"
+script_root="$(dirname "${script_path}")"
+
+repo_root="$(realpath "${script_root}/../..")"
+cd "${repo_root}"
+
+set -x
+
+pre-commit run --all-files "${@}"

diff --git a/code/authoring/run_tbump.sh b/code/authoring/run_tbump.sh
new file mode 100755
index 0000000..d044f98
--- /dev/null
+++ b/code/authoring/run_tbump.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# Copyright 2023-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+trap "exit 130" INT
+set -eu
+
+script_path="${0}"
+script_root="$(dirname "${script_path}")"
+
+repo_root="$(realpath "${script_root}/../..")"
+cwd="$(pwd)"
+
+PATH="${cwd}:${PATH}"
+export PATH
+
+version="${1}"
+shift
+
+set -x
+cd "${cwd}"
+
+git add .
+tbump --cwd="${cwd}" --no-push --no-tag-push "${version}" "${@}"
+
+cd "${repo_root}"
+./code/authoring/generate_changelog.sh \
+    || echo "WARNING: generate_changelog failed"
+git add CHANGELOG.md
+
+git commit --amend --no-edit --signoff
+git tag --force --sign --message="chore: bump to ${version}" "${version}"

diff --git a/code/authoring/setup_user.sh b/code/authoring/setup_user.sh
new file mode 100755
index 0000000..efe00c9
--- /dev/null
+++ b/code/authoring/setup_user.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# Copyright 2023-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+trap "exit 130" INT
+set -eu
+
+if [ -z "${2}" ] ; then
+    echo " Please provide a e-mail address and a user'a real name (quoted)."
+
+    exit 1
+fi
+
+set -x
+
+user_email="${1}"
+user_name="${2}"
+
+git config --local user.email "${user_email}"
+git config --local user.signingkey "${user_email}"
+git config --local user.name "${user_name}"
+
+git config --local commit.template .gitmessage

Reply via email to