diff --git a/libexec/sourcezap/commands/sourcezap-checkout b/libexec/sourcezap/commands/sourcezap-checkout index 39db0f6..dc6ca76 100755 --- a/libexec/sourcezap/commands/sourcezap-checkout +++ b/libexec/sourcezap/commands/sourcezap-checkout @@ -12,7 +12,7 @@ branch=$2 # functions git() { - "${libexec}"/utils/git "${@}" + "${libexec}"/utils/git/run "${@}" } printok() @@ -38,7 +38,7 @@ if ! "${libexec}"/utils/issourcezap-member > /dev/null 2>&1; then fi if [ ! -e "${gitdir}/.git" ]; then - printerr "try 'portzap clone' instead" + printerr "try 'sourcezap clone' instead" exit 1 fi diff --git a/libexec/sourcezap/commands/sourcezap-clone b/libexec/sourcezap/commands/sourcezap-clone index ac68c78..31dfaf8 100755 --- a/libexec/sourcezap/commands/sourcezap-clone +++ b/libexec/sourcezap/commands/sourcezap-clone @@ -13,7 +13,7 @@ branch=$3 # functions git() { - "${libexec}"/utils/git "${@}" + "${libexec}"/utils/git/run "${@}" } printok() diff --git a/libexec/sourcezap/commands/sourcezap-install b/libexec/sourcezap/commands/sourcezap-install index da916a0..735032c 100755 --- a/libexec/sourcezap/commands/sourcezap-install +++ b/libexec/sourcezap/commands/sourcezap-install @@ -15,8 +15,8 @@ revfile=$3 perform_update() { rev=$(cat "${revfile}") - add=$("${libexec}"/utils/git-changed-files "${gitdir}" "${rev}") - del=$("${libexec}"/utils/git-removed-files "${gitdir}" "${rev}") + add=$("${libexec}"/utils/git/get-changed-files "${gitdir}" "${rev}") + del=$("${libexec}"/utils/git/get-removed-files "${gitdir}" "${rev}") for file in ${del}; do target="${installdir}/${file}" parent=$(dirname "${target}") @@ -63,6 +63,11 @@ run_install() install -o root -g _sourcezap -m "${mode}" -v "$@" } +git() +{ + "${libexec}"/utils/git/run "${@}" +} + printok() { "${libexec}"/utils/printok "${1}" @@ -91,5 +96,5 @@ if [ -e "${revfile}" ]; then else perform_install fi -"${libexec}"/utils/git-rev "${gitdir}" > "${revfile}" +"${libexec}"/utils/git/run rev-parse HEAD > "${revfile}" printok "install complete" diff --git a/libexec/sourcezap/commands/sourcezap-pull b/libexec/sourcezap/commands/sourcezap-pull index 84adb47..e40b731 100755 --- a/libexec/sourcezap/commands/sourcezap-pull +++ b/libexec/sourcezap/commands/sourcezap-pull @@ -11,7 +11,7 @@ gitdir=$1 # functions git() { - "${libexec}"/utils/git "${@}" + "${libexec}"/utils/git/run "${@}" } printok() diff --git a/libexec/sourcezap/utils/git-rev b/libexec/sourcezap/utils/git-rev deleted file mode 100755 index db476b1..0000000 --- a/libexec/sourcezap/utils/git-rev +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -set -e - -## -# variables -localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)} -libexec="${localbase}"/libexec/sourcezap -gitdir=$1 - -## -# functions -git() -{ - "${libexec}"/utils/git "${1}" -} - -## -# main -cd "${gitdir}" -git rev-parse HEAD diff --git a/libexec/sourcezap/utils/git-changed-files b/libexec/sourcezap/utils/git/get-changed-files similarity index 55% rename from libexec/sourcezap/utils/git-changed-files rename to libexec/sourcezap/utils/git/get-changed-files index 4624d3d..ae70856 100755 --- a/libexec/sourcezap/utils/git-changed-files +++ b/libexec/sourcezap/utils/git/get-changed-files @@ -10,13 +10,13 @@ commit=$2 ## # functions -diff() +git() { - "${libexec}"/utils/gitdiff ${@} + "${libexec}"/utils/git/run "${@}" } ## # main cd "${gitdir}" -diff "--name-only" "--diff-filter=A" "${commit}" "HEAD" -diff "--name-only" "--diff-filter=M" "${commit}" "HEAD" +git diff -l0 --name-only --diff-filter=A "${commit}" "HEAD" +git diff -l0 --name-only --diff-filter=M "${commit}" "HEAD" diff --git a/libexec/sourcezap/utils/git-removed-files b/libexec/sourcezap/utils/git/get-removed-files similarity index 66% rename from libexec/sourcezap/utils/git-removed-files rename to libexec/sourcezap/utils/git/get-removed-files index 6531505..4ce4492 100755 --- a/libexec/sourcezap/utils/git-removed-files +++ b/libexec/sourcezap/utils/git/get-removed-files @@ -10,12 +10,12 @@ commit=$2 ## # functions -diff() +git() { - "${libexec}"/utils/gitdiff ${@} + "${libexec}"/utils/git/run "${@}" } ## # main cd "${gitdir}" -diff "--name-only" "--diff-filter=D" "${commit}" "HEAD" +git diff -l0 --name-only --diff-filter=D "${commit}" "HEAD" diff --git a/libexec/sourcezap/utils/git b/libexec/sourcezap/utils/git/run similarity index 100% rename from libexec/sourcezap/utils/git rename to libexec/sourcezap/utils/git/run diff --git a/libexec/sourcezap/utils/gitdiff b/libexec/sourcezap/utils/gitdiff deleted file mode 100755 index b1f0b7b..0000000 --- a/libexec/sourcezap/utils/gitdiff +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -set -e - -## -# variables -localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)} -libexec="${localbase}"/libexec/sourcezap - -## -# main -"${libexec}"/utils/git diff -l0 ${@}