Add gitdiff
Some checks are pending
portzap / shellcheck (push) Waiting to run

This commit is contained in:
0x1eef 2024-07-02 08:33:21 -03:00
parent 7de0fd39a0
commit 3f625d08db
4 changed files with 18 additions and 10 deletions

View file

@ -45,7 +45,6 @@ set -x
gitexec "clone ${giturl} ${gitdir}" gitexec "clone ${giturl} ${gitdir}"
cd "${gitdir}" cd "${gitdir}"
gitexec "config core.filemode off" gitexec "config core.filemode off"
gitexec "config diff.renameList 7000"
set +x set +x
set +e set +e
gitexec "checkout -t origin/${branch} > /dev/null 2>&1" gitexec "checkout -t origin/${branch} > /dev/null 2>&1"

View file

@ -10,15 +10,13 @@ commit=$2
## ##
# functions # functions
gitexec() diff()
{ {
"${libexec}"/utils/gitexec "${1}" "${libexec}"/utils/gitdiff ${@}
} }
## ##
# main # main
cd "${gitdir}" cd "${gitdir}"
add=$(gitexec "diff --name-only --diff-filter=A ${commit} HEAD") diff "--name-only" "--diff-filter=A" "${commit}" "HEAD"
mod=$(gitexec "diff --name-only --diff-filter=M ${commit} HEAD") diff "--name-only" "--diff-filter=M" "${commit}" "HEAD"
echo "${add}"
echo "${mod}"

View file

@ -10,12 +10,12 @@ commit=$2
## ##
# functions # functions
gitexec() diff()
{ {
"${libexec}"/utils/gitexec "${1}" "${libexec}"/utils/gitdiff ${@}
} }
## ##
# main # main
cd "${gitdir}" cd "${gitdir}"
gitexec "diff --name-only --diff-filter=D ${commit} HEAD" diff "--name-only" "--diff-filter=D" "${commit}" "HEAD"

View file

@ -0,0 +1,11 @@
#!/bin/sh
set -e
##
# variables
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
libexec="${localbase}"/libexec/portzap
##
# main
"${libexec}"/utils/gitexec diff -l0 ${@}