Closed schwern closed 10 years ago
I went ahead and rearchitected Gitpan::Dist. Gitpan::Repo now handles the coordination of Gitpan::Github and Gitpan::Git and does so lazily, it won't make a Github repository until its time to push. It handles making sure Git and Github are in sync. Gitpan::Dist will be just about feeding releases to Gitpan::Repo.
For example, the "test" distribution contains both JAMSHAID/test-1.1.tar.gz and YEWEI/test.tgz which are skipped. The importer makes a "test" repository on Github before checking to see if there's anything to import. The result is an empty "test" repository on Github which blocks the legit "Test" distribution from being imported.
The chain of events is as follows...
While convenient, that Gitpan::Dist will create repositories just to get a Git instance has been a problem in other places and has proven wasteful.
One solution would be to change
releases_to_import
to check if a Git or Github repository already exists. If not, don't make one.Another, more involved, would be to create a Gitpan::Git derivative which operates when there is no git repository. Some methods, such as releases, simply return false. Others, such as add_all, would create the repository on demand.
A third, and least magical, solution would be to add an explicit repository initialization step to Gitpan::Dist. Gitpan::Dist is probably over architected.