You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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.
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?
Activity
creationix commentedon Jun 13, 2014
The fs-db backend can read and write disk repos. The node version is at https://github.com/creationix/git-node-fs
codingisacopingstrategy commentedon Jul 9, 2014
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,
creationix commentedon Jul 9, 2014
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.
creationix commentedon Jul 9, 2014
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.
codingisacopingstrategy commentedon Jul 9, 2014
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?
codingisacopingstrategy commentedon Jul 9, 2014
The use case I imagined is for expanded README’s and other situations where code and documentation can be combined in novel ways.