jedbrown / git-fat

Simple way to handle fat files without committing them to git, supports synchronization using rsync
BSD 2-Clause "Simplified" License
622 stars 136 forks source link

Has anyone tried integrating git-fat with gitolite? #65

Closed gitfoxi closed 9 years ago

gitfoxi commented 9 years ago

Someone did with gitolite/git-annex.

http://git-annex.branchable.com/tips/using_gitolite_with_git-annex/

gitfoxi commented 9 years ago

To answer my own question, it's not so hard.

In your .gitolite.rc, add 'rsync' to the ENABLE list; also enable

    LOCAL_CODE                =>  "$ENV{HOME}/local",

Make a file ~/local/commands/rsync. Put something like this in it (maybe think harder about security than I did):

#!/usr/bin/perl

# restrict syncing to git-fat-store
# this could probably be more secure, requiring --ignore-existing

$STORE='git-fat-store';
$STORE_EXT="$STORE/";

if ( ($ARGV[-1] == '.' or $ARGV[-2] == '.') and ($ARGV[-1] eq $STORE_EXT or $ARGV[-2] eq $STORE_EXT))
{
  exec '/usr/bin/rsync', @ARGV;
}
else
{
  print STDERR "ERROR: In .gitfat, store must be specified as:\n";
  print STDERR "  remote = git:git-fat-store\n";
  print STDERR "  sshuser = git\n";
}

Make that ~/git-fat-store directory.

Works for me.

jedbrown commented 9 years ago

Thanks for the tip, @gitfoxi. I haven't used gitolite. If you'd like to convert this comment into a doc/gitolite.md pull request, I'm sure it would help some people out and I'd be happy to merge it.