use last commit date in git-add

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2020-12-24 12:13:53 +01:00
parent f4d64f7b0c
commit a9852efd0d
3 changed files with 9 additions and 9 deletions

View File

@ -3,7 +3,7 @@
#
# works together with git pre-push.sh and ADD all changed files since last push
#### $$VERSION$$ v1.2-dev2-23-g8379a62
#### $$VERSION$$ v1.2-dev2-64-gf4d64f7
# magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script
@ -14,24 +14,24 @@ else
echo "Sorry, no git repository $(pwd)" && exit 1
fi
[ ! -f .git/.lastpush ] && echo "No push or hooks not installed, use \"git add\" instead ... Abort" && exit
[ ! -f .git/.lastcommit ] && echo "No previous commit or hooks not installed, use \"git add\" instead ... Abort" && exit
set +f
FILES="$(find ./* -newer .git/.lastpush| grep -v -e 'DIST\/' -e 'STANDALONE\/' -e 'JSON.sh')"
set -f
# FILES="$(find ./* -newer .git/.lastpush)"
[ "${FILES}" = "" ] && echo "Noting changed since last push ... Abort" && exit
[ "${FILES}" = "" ] && echo "Noting changed since last commit ..." && exit
# run pre_commit on files
dev/hooks/pre-commit.sh
echo -n "Add files to repo: "
echo -e "Add files to repo: \c"
# shellcheck disable=SC2086
for file in ${FILES}
do
[ -d "${file}" ] && continue
echo -n "${file} "
echo -e "${file} \c"
git add "$file"
done
git add .
echo "done."
echo " - Done."

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ v1.2-dev2-63-g69ca15a
#### $$VERSION$$ v1.2-dev2-64-gf4d64f7
############
# NOTE: you MUST run install-hooks.sh again when updating this file!

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# this has to run once atfer git clone
# and every time we create new hooks
#### $$VERSION$$ v1.2-dev2-63-g69ca15a
#### $$VERSION$$ v1.2-dev2-64-gf4d64f7
# magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script