8 # --- GIT -----------------------------------------------------------------------
13 while [ -n "$work_dir" -a "$work_dir" != "/" ]; do
14 [ -d "${work_dir}/.git" ] && {
15 echo "${work_dir}/.git/"
18 work_dir
=`dirname "$work_dir"`
23 changesetfs_list_git
()
30 GIT_DIR
=`found_git_dir "$WORK_DIR"`
31 [ -z "$GIT_DIR" ] && GIT_DIR
=$WORK_DIR
32 curr_year
=`date +"%Y"`
34 git
--git-dir="$GIT_DIR" log
--abbrev=7 --pretty="format:%at %h %an" -- "$fname" |
while read TIMESTAMP chset author
36 year
=`date -d @"$TIMESTAMP" +"%Y"`
37 [ "$year" = "$curr_year" ] && {
38 DATE
=`date -d @"$TIMESTAMP" +"%b %d %H:%M"`
40 DATE
=`date -d @"$TIMESTAMP" +"%b %d %Y"`
43 echo "-rw-rw-rw- 1 $USER 0 0 $DATE $NAME `basename $fname`"
47 changesetfs_copyout_git
()
54 chset
=`echo "$orig_fname"| cut -f 1 -d " "`
56 GIT_DIR
=`found_git_dir "$WORK_DIR"`
57 [ -z "$GIT_DIR" ] && GIT_DIR
=$WORK_DIR
59 filecommit
=`git --git-dir="$GIT_DIR" show --raw --pretty=tformat:%h "$chset" -- "$fname"| \
61 sed 's@^::[0-9]*\s*[0-9]*\s*[0-9]*\s*@@' | \
62 sed 's@^:[0-9]*\s*[0-9]*\s*@@' | \
64 git
--git-dir="$GIT_DIR" show
"$filecommit" > "$output_fname"
67 # --- COMMON --------------------------------------------------------------------
75 DATE
=`date +"%b %d %H:%M"`
79 git
) changesetfs_list_git
"$WORK_DIR" "$fname" "$USER" "$DATE" ;;
90 git
) changesetfs_copyout_git
"$WORK_DIR" "$fname" "$@" ;;
95 # --- MAIN ----------------------------------------------------------------------
100 WORK_DIR
=`head -n1 $tmp_file`
101 fname
=`tail -2 $tmp_file | head -n1`
102 VCS_type
=`tail -1 $tmp_file`
105 list
) changesetfs_list
"$VCS_type" "$WORK_DIR" "$fname" ;;
106 copyout
) changesetfs_copyout
"$VCS_type" "$WORK_DIR" "$fname" "$@" ;;