Hi Frank On Donnerstag, 21. April 2022 10:01:29 CEST Frank Lichtenheld wrote: > > +# If called so, install this script as pre-commit hook > > +if [ "$1" = "install" ] ; then > > + ROOTDIR=$(git rev-parse --show-toplevel) > > + HOOKSDIR="$ROOTDIR/.git/hooks" > > Actually, the correct way to find the actual hooks directory is > git rev-parse --git-path hooks > That takes all configuration like $GIT_DIR and core.hooksDir into account.
Nice one, will add in v2. > > + TARGET="$HOOKSDIR/pre-commit" > > + > > + if [ -e "$TARGET" ] ; then > > + printf "$TARGET file exists. Won't overwrite.\n" > > Any reason we're using printf here instead of echo? The latter > would avoid the ugly line endings. Consistency. The script uses printf everywhere. Heiko _______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel