From c03419125442c17c4a87c16a211ea5f4ab29b6f4 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Tue, 27 Dec 2022 16:09:01 +0100 Subject: [PATCH] git: Add aur-package template folder Use `init.templateDir` to use this. --- .../git/templates/aur-package/description | 1 + .../templates/aur-package/hooks/pre-commit | 20 +++++++++++++++++++ .../git/templates/aur-package/info/exclude | 3 +++ 3 files changed, 24 insertions(+) create mode 100644 .local/share/git/templates/aur-package/description create mode 100644 .local/share/git/templates/aur-package/hooks/pre-commit create mode 100644 .local/share/git/templates/aur-package/info/exclude diff --git a/.local/share/git/templates/aur-package/description b/.local/share/git/templates/aur-package/description new file mode 100644 index 0000000..498b267 --- /dev/null +++ b/.local/share/git/templates/aur-package/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/.local/share/git/templates/aur-package/hooks/pre-commit b/.local/share/git/templates/aur-package/hooks/pre-commit new file mode 100644 index 0000000..45f7de0 --- /dev/null +++ b/.local/share/git/templates/aur-package/hooks/pre-commit @@ -0,0 +1,20 @@ +#!/bin/sh +# +# An hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the commit. + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) +fi + +# Redirect output to stderr. +exec 1>&2 + +# Regenerate .SRCINFO +makepkg --printsrcinfo >.SRCINFO +git add .SRCINFO diff --git a/.local/share/git/templates/aur-package/info/exclude b/.local/share/git/templates/aur-package/info/exclude new file mode 100644 index 0000000..4e9c4d0 --- /dev/null +++ b/.local/share/git/templates/aur-package/info/exclude @@ -0,0 +1,3 @@ +* +!/PKGBUILD +!/.SRCINFO