diff --git a/.git-hooks/post-commit b/.git-hooks/post-commit deleted file mode 100644 index 5aa2d40e..00000000 --- a/.git-hooks/post-commit +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -# -# MIT License -# -# Copyright (c) 2021 Qingtian Wang -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# - -echo -if [ -e .commit ]; then - rm .commit - git fetch --all - CURRENT_BRANCH=$(git branch --show-current) - echo "Current branch: " "$CURRENT_BRANCH" - CURRENT_POM_SEMVER=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout | tr -d "[:space:]") - echo "Current POM version: " "$CURRENT_POM_SEMVER" - cp pom.xml pom.xml.local - rm pom.xml - git checkout origin/"$CURRENT_BRANCH" pom.xml - REMOTE_POM_SEMVER=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout | tr -d "[:space:]") - echo "Remote POM version: " "$REMOTE_POM_SEMVER" - cp pom.xml.local pom.xml - rm pom.xml.local - mvn io.github.q3769:semver-maven-plugin:20221011.0.3:merge -Dsemver="$REMOTE_POM_SEMVER" - MERGED_POM_SEMVER=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout | tr -d "[:space:]") - echo "Merged POM semver: " "$MERGED_POM_SEMVER" - git add pom.xml - git commit --amend -C HEAD --no-verify -fi -exit diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit deleted file mode 100644 index 85b2fad5..00000000 --- a/.git-hooks/pre-commit +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# MIT License -# -# Copyright (c) 2021 Qingtian Wang -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# - -# -# An example 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. -# -# To enable this hook, rename this file to "pre-commit". - -echo -if [ -z "$(git status --porcelain)" ]; then - # Working directory clean - exit -else - # Uncommitted changes - touch .commit -fi -exit