Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source code archives are missing Git submodules #29

Open
beltex opened this issue Jun 23, 2015 · 0 comments
Open

Source code archives are missing Git submodules #29

beltex opened this issue Jun 23, 2015 · 0 comments
Labels

Comments

@beltex
Copy link
Owner

beltex commented Jun 23, 2015

This is not a dshb issue per se, but it does affect it, and so opening this up as a means to track things. Quoting 273c6a1 commit message.

git-archive(1) unfortunately does not currently support including submodules in the archive it creates. This seems to be why both the "Download Zip" option on GitHub and the "Source code" tar and zip that comes with a release are missing submodules, as there using git-archive(1) underneath it seems [1]. There was a discussion a few months back on the Git mailing list about adding this functionality [2]. In the mean time we need a work around. Not only to have a real archive (the current ones won't work at all as there not real Git repos, so you can't even init the submodules), but also for folks who don't have Git or don't want to use it, they can just curl/Wget the archive and be able to build. There are various scripts out there to address this. However, they do a lot more than what we need and add yet another dependency. Thus, came up with a small shell script to do this. Added two methods of doing this to the Makefile for now.

The key problem in doing this is ignoring files in the .gitignore (which git-archive(1) does automatically). The first approach does everything locally, archiving the main repo and all the submodules individually and then putting all that together. The second approach which is simpler, but relies on remote, does a fresh clone, init's the submodules and zip's all that. This works because the repo being new is free of any files in the .gitignore (except for .git/ but thats easy to exclude via zip).

There is another option, even simpler, in which we just zip the current directory and feed in .gitignore into zip's exclude option. However, zip's exclude is a bit strange, had trouble with this approach.

[1] https://blogs.law.harvard.edu/acts/2012/10/18/github-zip-doesnt-include-submodules/#comment-975
[2] http://www.mail-archive.com/git%40vger.kernel.org/msg68665.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant