mirror of
https://github.com/flynx/git-utils.git
synced 2025-10-28 10:40:08 +00:00
Compare commits
4 Commits
ef04c3f59b
...
a773d1a668
| Author | SHA1 | Date | |
|---|---|---|---|
| a773d1a668 | |||
| 33ebc6e5aa | |||
| b1688c36b6 | |||
| 5097df0717 |
2
LICENSE
2
LICENSE
@ -1,4 +1,4 @@
|
||||
Copyright (c) 2023, Alex A. Naanou
|
||||
Copyright (c) 2023-2024, Alex A. Naanou
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
45
bin/git-chmod
Normal file
45
bin/git-chmod
Normal file
@ -0,0 +1,45 @@
|
||||
#!/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
|
||||
echo "This is useful in default configurations of git on Windows."
|
||||
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 :
|
||||
@ -76,8 +76,3 @@ done
|
||||
|
||||
|
||||
# vim:set sw=4 ts=4 :
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user