This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Eric's profile picture

Github repository cloner

Started by Eric, 10 January 2013 - 08:15 AM
Eric #1
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.
NeverCast #2
Posted 14 January 2013 - 03:37 PM
Very nice program Eric! Thanks!
CoolisTheName007 #3
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.
elexx #4
Posted 19 March 2013 - 12:02 AM
Great work! :clap:
Tiin57 #5
Posted 22 March 2013 - 04:56 AM
Now port the Git utility to Lua. :3
Sammich Lord #6
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.
PixelToast #7
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
CoolisTheName007 #8
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.