diff options
Diffstat (limited to 'src/vfs/extfs/helpers/gitfs+')
-rwxr-xr-x | src/vfs/extfs/helpers/gitfs+ | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/vfs/extfs/helpers/gitfs+ b/src/vfs/extfs/helpers/gitfs+ new file mode 100755 index 0000000..66861fb --- /dev/null +++ b/src/vfs/extfs/helpers/gitfs+ @@ -0,0 +1,39 @@ +#!/bin/sh + +LANG=C +export LANG +LC_TIME=C +export LC_TIME + +umask 077 +prefix='[git]' + +gitfs_list() +{ + DATE=`date +"%b %d %H:%M"` + GIT_DIR="$2/.git" + user=`whoami` + git ls-files -v -c -m -d | sort -k 2 | uniq -f 1 | while read status fname + do + [ "$status" = "H" ] && status=" " + [ "$status" = "C" ] && status="*" + echo "-r--r--r-- 1 $user 0 0 $DATE `dirname $fname`/$prefix$status`basename $fname`" + done +} + +gitfs_copyout() +{ + printf "%s\n" "$2" > "$4" + b=`echo "$prefix"| wc -c` + b=`expr "$b" + 1` + # remove prefix from file name + echo "`dirname "$3"`/`basename "$3" | tail -c+"$b"`" >> "$4" + echo "git" >> "$4" +} + +case "$1" in + list) gitfs_list "$@" ;; + copyout) gitfs_copyout "$@" ;; + *) exit 1 ;; +esac +exit 0 |