added git-chmod

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2024-01-09 03:32:05 +03:00
parent 11a318c9dc
commit 5097df0717
2 changed files with 43 additions and 5 deletions

43
bin/git-chmod Normal file
View File

@ -0,0 +1,43 @@
#!/usr/bin/bash
while true ; do
case $1 in
-h|--help)
echo "Usage: $(basename "$0") MODE FILE ..."
echo
echo "Change file mode on file(s)."
echo
echo "Options:"
echo " -h --help - print this message and exit"
echo
echo "This is equivalent to:"
echo " $ git update-index --chmod=MODE FILE ..."
echo
exit
;;
-*|--*)
echo "Error: unknown option: \"$1\"" >&2
exit
;;
*)
break
;;
esac
done
if [[ $# < 2 ]] ; then
echo "Error need at least two arguments."
exit 1
fi
MODE=$1
shift
git update-index --chmod="$MODE" "$@"
# vim:set sw=4 ts=4 :

View File

@ -77,8 +77,3 @@ done
# vim:set sw=4 ts=4 :