Joey Hess:
> Thomas Koch wrote:
> > It'd be of course wonderful if I could tell git-annex directly to import
> > all files of the disc. Duplicate files should symlink to the same file
> > in the git- annex backend, shouldn't they?
> 
> Yes. If you don't mind the overhead of copying all the files, simply
> copying the whole CD to a subdirectory and running git annex add will do
> the trick. Any duplicate files will coalesce when added.

Certainly not perfect but good enough:

CDDIR=$1

find $CDDIR -type f -print | while read F
do
#  echo searching $F
  FILENAME=$(basename "$F")
  FOUND=$(find . -path .git -prune -o -name "$FILENAME" -print|head -n 1)
  if [ -r "$FOUND" ]
  then
    echo found $FOUND
  else
    echo not found: $F
    DIRNAME=$(dirname "$F")
    mkdir -p ./"$DIRNAME"
    cp -v "$F" ./"$DIRNAME"
  fi
done 

Still, a solution integrated in git-annex would be wonderful!

Thomas Koch, http://www.koch.ro
_______________________________________________
vcs-home mailing list
vcs-home@lists.madduck.net
http://lists.madduck.net/listinfo/vcs-home

Reply via email to