88 posts
Location
UK
Posted 10 January 2013 - 09:15 AM
I've thrown together a program to download a complete snapshot of a github repository -
any git repository.
You can download it
here, using my new tool… Oh, wait. Seriously though, go there, download the three files, and you're good to go.
Instructions are at the link above, but I'll duplicate the usage section here:
> github clone eric-wieser/computercraft-github ccgit
Discovering files...
Downloading:
readme.md
apis/dkjson
apis/github
programs/github
[============================================] 100%
> ls ccgit
apis programs
readme.md
Word of warning - github puts a limit on API requests (60 per hour, I think) - you may have problems cloning repositories with a large number of files and folders, particularly if github treats all users on a server as the same client.
This program also comes with an (skeleton) API to expose github information to other programs.
392 posts
Location
Christchurch, New Zealand
Posted 14 January 2013 - 03:37 PM
Very nice program Eric! Thanks!
302 posts
Posted 17 March 2013 - 06:42 AM
Word of warning - github puts a limit on API requests (60 per hour, I think) - you may have problems cloning repositories with a large number of files and folders, particularly if github treats all users on a server as the same client.
Ah. That's useful to know. Wished I hadn't spent one hour looking for an answer….
Guess I'll have to write something to package everything in one file, and then un-package itself. Or see if dropbox behaves the same way.
9 posts
Location
/home/elexx
Posted 19 March 2013 - 12:02 AM
Great work! :clap:
1243 posts
Location
Indiana, United States
Posted 22 March 2013 - 04:56 AM
Now port the Git utility to Lua. :3
1214 posts
Location
The Sammich Kingdom
Posted 22 March 2013 - 05:01 AM
Word of warning - github puts a limit on API requests (60 per hour, I think) - you may have problems cloning repositories with a large number of files and folders, particularly if github treats all users on a server as the same client.
Ah. That's useful to know. Wished I hadn't spent one hour looking for an answer….
Guess I'll have to write something to package everything in one file, and then un-package itself. Or see if dropbox behaves the same way.
If the script just grabs it from raw.github.com then it doesn't make a request for the API, it just requests the URL. I haven't checked to see how it works though.
2217 posts
Location
3232235883
Posted 22 March 2013 - 05:02 AM
and git clone :3
though interfacing with the api will be hard
you might need a php file
302 posts
Posted 22 March 2013 - 12:54 PM
If the script just grabs it from raw.github.com then it doesn't make a request for the API, it just requests the URL. I haven't checked to see how it works though.
I've checked the code I had for getting github stuff and it made a request for the repository contents for each directory path, and then it queried /raw.
I suppose a safe way to do things is to somehow avoid rechecking each repository path.