-
Notifications
You must be signed in to change notification settings - Fork 264
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
example to do git.init on a local directory? #103
Comments
The fs-db backend can read and write disk repos. The node version is at https://github.com/creationix/git-node-fs |
Interesting stuff. That requires running a server process though. What I wanted to use js-git for, is to read in a local git repository so I can display its tree: given that I can read local files through ajax requests, I wouldn’t need anything beyond what’s already in the browser. Would I need to write a special back-end for this? Thanks, |
Yes, you can read files from the browser, but you can't scan directories. Many files (pack files for example) are unguessable filenames. As long as your repo doesn't use pack-files (most do), it would be possible to write a custom backend using nothing than xhr requests. |
Another option would be to add support for the metadata http://git-scm.com/docs/git-update-server-info provides. Then a "dumb" client could read the git repo with nothing more than xhr requests. You'd have to externally make sure the extra metadata is kept up to date whenever the git repo is modified. |
Hey, Thanks for the swift reply + the insights in git internals. It’s true that it’s less useful if this metadata has to be kept up to date for each commit… do you know if this metadata is transferred when a repository is pushed to a remote, i.e. a github repository? |
The use case I imagined is for expanded README’s and other situations where code and documentation can be combined in novel ways. |
goes Js-Git support local filesystem directories? All I can find are some in-mem structures?
The text was updated successfully, but these errors were encountered: