diff options
author | Dany Marcoux | 2016-06-14 21:33:20 +0200 |
---|---|---|
committer | Dany Marcoux | 2016-06-14 22:34:05 +0200 |
commit | d57d31f9ad3685911fe984700811a16b5538d85c (patch) | |
tree | 333b62da1c23df37f6a784bab38a578e7b8997ca | |
parent | d0f7b31d9543ee5627173ec99f3a09ca1982303f (diff) | |
download | aur-d57d31f9ad3685911fe984700811a16b5538d85c.tar.gz |
Pre-release tag-ag 1.0.0-3
Setup git pre-commit hook to generate .SRCINFO file and add it to the commit if it changed
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 2 | ||||
-rw-r--r-- | README.md | 6 | ||||
-rwxr-xr-x | pre-commit.sh | 13 |
4 files changed, 21 insertions, 2 deletions
@@ -1,7 +1,7 @@ pkgbase = tag-ag pkgdesc = tag: Instantly jump to your ag matches pkgver = 1.0.0 - pkgrel = 2 + pkgrel = 3 url = https://github.com/aykamko/tag arch = i686 arch = x86_64 @@ -2,7 +2,7 @@ pkgname=tag-ag pkgver=1.0.0 -pkgrel=2 +pkgrel=3 pkgdesc='tag: Instantly jump to your ag matches' arch=('i686' 'x86_64') url='https://github.com/aykamko/tag' diff --git a/README.md b/README.md index f7196f263899..718f37930837 100644 --- a/README.md +++ b/README.md @@ -37,3 +37,9 @@ It is as simple as running the following command in the repository's root direct ```bash $ mksrcinfo ``` + +However, I prefer to use a git pre-commit hook ([pre-commit.sh](pre-commit.sh)) to do this automatically. Set it up with this command: + +```bash +$ ln -s ../../pre-commit.sh .git/hooks/pre-commit +``` diff --git a/pre-commit.sh b/pre-commit.sh new file mode 100755 index 000000000000..1cfdd8f132b4 --- /dev/null +++ b/pre-commit.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# git pre-commit hook: Generate the .SRCINFO file and add it to the commit if it changed + +# Generate the .SRCINFO file based on the PKGBUILD file +mksrcinfo + +# Check if the .SRCINFO file changed +if [ -n "$(git diff --name-only | grep ^.SRCINFO$)" ]; then + printf "Updated .SRCINFO file\n" + git diff .SRCINFO + git add .SRCINFO + printf "\nAdded .SRCINFO file to the commit\n" +fi |