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:


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

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

Thomas Koch,
vcs-home mailing list

Reply via email to