Add gitdiff

This commit is contained in:
0x1eef 2024-07-02 08:39:59 -03:00
parent d54f37d3b6
commit 1c344e0c60
3 changed files with 18 additions and 9 deletions

View file

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

View file

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

11
libexec/sourcezap/utils/gitdiff Executable file
View file

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