Compare commits
4 commits
cd1e504643
...
ba02f11793
Author | SHA1 | Date | |
---|---|---|---|
ba02f11793 | |||
0174a27bb2 | |||
d344673f66 | |||
fb4629fda5 |
8 changed files with 38 additions and 18 deletions
19
RELEASENOTES.txt
Normal file
19
RELEASENOTES.txt
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
v?.?.?
|
||||||
|
|
||||||
|
* Set "diff.renameLimit" to unlimited
|
||||||
|
After this change, sourcezap always forwards "-l0" to "git diff"
|
||||||
|
|
||||||
|
* Replace utils/gitexec with utils/git/run
|
||||||
|
After this change, we talk to git via utils/git/run
|
||||||
|
|
||||||
|
* Add utils/git/
|
||||||
|
A dedicated directory for git-related scripts
|
||||||
|
|
||||||
|
* Remove "set -x"
|
||||||
|
After this change, sourcezap emits less output
|
||||||
|
|
||||||
|
* Remove scripts
|
||||||
|
Remove "utils/printok", "utils/printerr", "utils/git-rev"
|
||||||
|
|
||||||
|
* Add documentation
|
||||||
|
Covers README.md and sourcezap.8
|
|
@ -5,6 +5,7 @@ set -e
|
||||||
# variables
|
# variables
|
||||||
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
|
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
|
||||||
libexec="${localbase}"/libexec/sourcezap
|
libexec="${localbase}"/libexec/sourcezap
|
||||||
|
git="${libexec}"/utils/git/run
|
||||||
gitdir=$1
|
gitdir=$1
|
||||||
branch=$2
|
branch=$2
|
||||||
|
|
||||||
|
@ -30,6 +31,7 @@ if [ ! -e "${gitdir}/.git" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd "${gitdir}"
|
cd "${gitdir}"
|
||||||
git fetch origin
|
"${git}" fetch origin
|
||||||
git checkout "${branch}" || git checkout -t origin/"${branch}"
|
"${git}" checkout "${branch}" ||
|
||||||
|
"${git}" checkout -t origin/"${branch}"
|
||||||
printok "${branch} checked out"
|
printok "${branch} checked out"
|
||||||
|
|
|
@ -5,6 +5,7 @@ set -e
|
||||||
# variables
|
# variables
|
||||||
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
|
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
|
||||||
libexec="${localbase}"/libexec/sourcezap
|
libexec="${localbase}"/libexec/sourcezap
|
||||||
|
git="${libexec}"/utils/git/run
|
||||||
giturl=$1
|
giturl=$1
|
||||||
gitdir=$2
|
gitdir=$2
|
||||||
branch=$3
|
branch=$3
|
||||||
|
@ -30,8 +31,8 @@ if [ -e "${gitdir}/.git" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git clone "${giturl}" "${gitdir}"
|
"${git}" clone "${giturl}" "${gitdir}"
|
||||||
cd "${gitdir}"
|
cd "${gitdir}"
|
||||||
git config core.filemode off
|
"${git}" config core.filemode off
|
||||||
git checkout -t origin/"${branch}"
|
"${git}" checkout -t origin/"${branch}"
|
||||||
printok "clone complete"
|
printok "clone complete"
|
||||||
|
|
|
@ -6,6 +6,7 @@ set -e
|
||||||
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
|
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
|
||||||
libexec="${localbase}"/libexec/sourcezap
|
libexec="${localbase}"/libexec/sourcezap
|
||||||
mode=u=rwX,g=rX,o=
|
mode=u=rwX,g=rX,o=
|
||||||
|
git="${libexec}"/utils/git/run
|
||||||
gitdir=$1
|
gitdir=$1
|
||||||
installdir=$2
|
installdir=$2
|
||||||
revfile=$3
|
revfile=$3
|
||||||
|
@ -72,7 +73,7 @@ if [ "$(id -u)" != "0" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
umask ${mode}
|
umask "${mode}"
|
||||||
cd "${gitdir}"
|
cd "${gitdir}"
|
||||||
run_install "-d" "${installdir}"
|
run_install "-d" "${installdir}"
|
||||||
chmod ${mode} "${installdir}"
|
chmod ${mode} "${installdir}"
|
||||||
|
@ -81,5 +82,5 @@ if [ -e "${revfile}" ]; then
|
||||||
else
|
else
|
||||||
perform_install
|
perform_install
|
||||||
fi
|
fi
|
||||||
git rev-parse HEAD > "${revfile}"
|
"${git}" rev-parse HEAD > "${revfile}"
|
||||||
printok "install complete"
|
printok "install complete"
|
||||||
|
|
|
@ -5,6 +5,7 @@ set -e
|
||||||
# variables
|
# variables
|
||||||
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
|
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
|
||||||
libexec="${localbase}"/libexec/sourcezap
|
libexec="${localbase}"/libexec/sourcezap
|
||||||
|
git="${libexec}"/utils/git/run
|
||||||
gitdir=$1
|
gitdir=$1
|
||||||
|
|
||||||
##
|
##
|
||||||
|
@ -24,12 +25,11 @@ if ! "${libexec}"/utils/issourcezap-member > /dev/null 2>&1; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e "${gitdir}/.git" ]; then
|
if [ ! -e "${gitdir}/.git" ]; then
|
||||||
set +x
|
|
||||||
printerr "try 'sourcezap clone' instead"
|
printerr "try 'sourcezap clone' instead"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd "${gitdir}"
|
cd "${gitdir}"
|
||||||
branch=$(git branch --show-current)
|
branch=$("${git}" branch --show-current)
|
||||||
git pull --rebase origin "${branch}"
|
"${git}" pull --rebase origin "${branch}"
|
||||||
printok "pull complete"
|
printok "pull complete"
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
git()
|
|
||||||
{
|
|
||||||
"${libexec}"/utils/git/run "${@}"
|
|
||||||
}
|
|
||||||
|
|
||||||
printok()
|
printok()
|
||||||
{
|
{
|
||||||
printf "ok: %s\n" "${@}" > /dev/stdout
|
printf "ok: %s\n" "${@}" > /dev/stdout
|
||||||
|
|
|
@ -5,6 +5,7 @@ set -e
|
||||||
# variables
|
# variables
|
||||||
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../../..)}
|
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../../..)}
|
||||||
libexec="${localbase}"/libexec/sourcezap
|
libexec="${localbase}"/libexec/sourcezap
|
||||||
|
git="${libexec}"/utils/git/run
|
||||||
gitdir=$1
|
gitdir=$1
|
||||||
commit=$2
|
commit=$2
|
||||||
|
|
||||||
|
@ -15,5 +16,5 @@ commit=$2
|
||||||
##
|
##
|
||||||
# main
|
# main
|
||||||
cd "${gitdir}"
|
cd "${gitdir}"
|
||||||
git diff -l0 --name-only --diff-filter=A "${commit}" "HEAD"
|
"${git}" diff -l0 --name-only --diff-filter=A "${commit}" "HEAD"
|
||||||
git diff -l0 --name-only --diff-filter=M "${commit}" "HEAD"
|
"${git}" diff -l0 --name-only --diff-filter=M "${commit}" "HEAD"
|
||||||
|
|
|
@ -5,6 +5,7 @@ set -e
|
||||||
# variables
|
# variables
|
||||||
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../../..)}
|
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../../..)}
|
||||||
libexec="${localbase}"/libexec/sourcezap
|
libexec="${localbase}"/libexec/sourcezap
|
||||||
|
git="${libexec}"/utils/git/run
|
||||||
gitdir=$1
|
gitdir=$1
|
||||||
commit=$2
|
commit=$2
|
||||||
|
|
||||||
|
@ -15,4 +16,4 @@ commit=$2
|
||||||
##
|
##
|
||||||
# main
|
# main
|
||||||
cd "${gitdir}"
|
cd "${gitdir}"
|
||||||
git diff -l0 --name-only --diff-filter=D "${commit}" "HEAD"
|
"${git}" diff -l0 --name-only --diff-filter=D "${commit}" "HEAD"
|
||||||
|
|
Loading…
Reference in a new issue