epio/epio-client — pull request #3 by carljm (2011-12-06 21:00:17+00:00)
Title: Fix 'epio upload' ignoring submodules.

"epio upload" is supposed to upload your current directory in a VCS-agnostic way, including everything except what's listed in .epioignore.

It fails to do this in the presence of git submodules, because it removes any top-level .git or .gitignore files after copying everything to its temp repo, but it doesn't remove any .git or .gitignore files found deeper in the tree. The effect is that submodules are entirely omitted from the upload, even though the files are present on the local filesystem.

One workaround is to deploy via "git push" rather than "epio upload", but this is not an option in several cases:

1. The submodule is authenticated, so epio can't pull it down recursively.
2. There are some git-ignored files which should be uploaded (for instance, Django collected static files).

This pull request contains a quick and easy fix, which is to use "find" to recursively delete any .git directories or .gitignore files found anywhere in the tree.

I think it might be more robust to implement the initial file copy in Python using os.walk rather than shelling out to cp; then undesirable files/directories could simply be omitted from the copy in the first place.

Unfortunately, cp does not have an "exclude" argument. Another option would be to use rsync with an exclude option rather than cp, but I don't know if you can count on the presence of rsync or not.

I'm willing to work on a pull request either using rsync or copying in Python, if one of those solutions is preferable to using find.