Comments (6)
Good idea.
So for a bare local repo, all that's needed is the git-db interface. Inflate and Deflate are internal implementation details for that. Network communication is a little trickier. For clone/fetch/ls-remote the platform needs to provide tcp, http, and/or ssh interfaces (depending on which protocols you want to support).
If you want to use the built-in fs-db library, then you do need inflate/deflate/sha1 as well as an fs instance.
If you want to have a working directory, you need to provide an fs instance as part of the git-db interface. You don't have to use the fs-db adapter library. You could do this with only indexdb by emulating the fs on top of the indexdb system, but using indexdb directly for the git-db implementation.
from js-git.
@creationix yes but I was thinking about the "platform" package and what implementations of it need to provide.
But now that I think about I have confused the low-level with higher level requirements!
So with https://github.com/creationix/js-git-node-platform it provides node-based implementations of: sha1, inflate/deflate, fs, http, ssh, etc
And then a (imaginary) js-git-node-lib would provide object-db, working-dir, index-db, ls-remote, fetch, push, etc on top of what the platform module provides. The rough equivalent of cgit "plumping" cmds.
Does that makes sense?
from js-git.
I don't there would be such a high-level library, and if there was, it would be simply:
require('js-git/lib/platform.js')(require('js-git-node-platform'));
module.exports = require('js-git');
Assuming that js-git eventually exports a central thing.
All the high-level APIs will either be in js-git itself or in js-git addon modules, both which would be platform independent I think.
from js-git.
@creationix Yes you're right as usual! :-)
I had an even harder think about it and yes i can see that a platform just needs to expose the git-db interface for bare repo access.
For any kind of remote ops, it needs to expose at least 1 transport protocol (http, ssh, etc).
And then to support working dirs it needs to expose a fs interface.
But what about the index, do we need a seperate interface for it? or is it just something that client code of js-git will just handle itself?
from js-git.
As discussed on irc, the index interface should have: add/remove/read/list functions.
from js-git.
I documented this in the main README at the js-git repo.
We'll be adding more as we implement the other milestones.
from js-git.
Related Issues (20)
- Generating repo statistics using js-git HOT 2
- NodeJS Git Server HOT 4
- what is wrong with my syntax?
- repo.unpack callback is never called using HTTP transport HOT 7
- Where can I find examples? HOT 18
- Pull / push HOT 7
- commit.parents is not defined when using logWalk HOT 2
- Octal modes HOT 2
- read ref-delta cause infinite loop... HOT 2
- NPM package is outdated HOT 1
- Example on README doesn't show that the yield loadAs returns an array
- es-git: js-git 2.0 HOT 18
- Clone URL in browser? HOT 10
- pack-ops mixing doesn't work HOT 5
- Replace github-db with private git server? HOT 4
- In-memory file system HOT 2
- resolveRef should be available through a mix-in HOT 2
- Typo in mem-cache dupe?
- support simple HTTP protocol HOT 25
- bountysource.com/fundraisers is dead and the about link is sad HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-git.