Skip to content

example to do git.init on a local directory? #103

Open

Description

@geertbrit

goes Js-Git support local filesystem directories? All I can find are some in-mem structures?

Activity

  1. creationix commented on Jun 13, 2014

    @creationix
    Owner

    The fs-db backend can read and write disk repos. The node version is at https://github.com/creationix/git-node-fs

  2. codingisacopingstrategy commented on Jul 9, 2014

    @codingisacopingstrategy

    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,

  3. creationix commented on Jul 9, 2014

    @creationix
    Owner

    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.

  4. creationix commented on Jul 9, 2014

    @creationix
    Owner

    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.

  5. codingisacopingstrategy commented on Jul 9, 2014

    @codingisacopingstrategy

    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?

  6. codingisacopingstrategy commented on Jul 9, 2014

    @codingisacopingstrategy

    The use case I imagined is for expanded README’s and other situations where code and documentation can be combined in novel ways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions