GeezerVison is showing github.com — Include a git distribution, as many packages on npm depend on it · Issue #67 · NodeOS/NodeOS
Include a git distribution, as many packages on npm depend on it #67Descriptionnpm depends on git in the following ways (credit to @isaacs):
- Parsing out the git remote for npm init (see Implement
git config --get remote.<remote>.url maryrosecook/gitlet#8)
- Fetching dependencies that are listed as git urls (gitlet, possibly jsgit)
- Verifying that the git repo is clean on npm version
- Committing and tagging the local repo on npm version (and, optionally, signing said tag by passing the -s arg to git.)
The issue should be closed once a git is found that can run on NodeOS and can do all of these. Activitypiranna commented on Sep 16, 2014 There are several pure-Javascript git client libraries (https://www.npmjs.org/package/git, https://www.npmjs.org/package/js-git), but seems none of them has a CLI... :-/
Could you be able to point us why a git CLI command is needed? NPM should manage automatically git repositories and not depend on external tools, and if so, then it should be fixed... dbkaplun commented on Sep 17, 2014 @piranna see here. npm allows git dependencies, but requires a git command as an external tool in order to fetch them. piranna commented on Sep 17, 2014 I know npm support git urls (we use them at work during development since we only publish on npm the stable releases), I'm only saying npm should use a Javascript library instead of a external command. seanewest commented on Sep 17, 2014 I think it would be cool to implement a minimal CLI on top of https://github.com/creationix/js-git . We could start by just implementing the functionality that npm requires out of the git command line tool. piranna commented on Sep 17, 2014 groundwater commented on Sep 22, 2014 I think in general, a git written in pure-js that fulfills all of npm's needs would be fantastic. Perhaps @othiym23 has a word on how useful that would be. othiym23 commented on Sep 22, 2014 It would be fantastic! Obviously! But the amount of git that npm uses is pretty hefty at this point. It's mostly git clone, git status, and git tag (with support for calling out to gpg --sign), but lots of different kinds of git URLS, lots of permissions logic, etc. dbkaplun commented on Sep 22, 2014 Would it be possible to package git as a binary that works in NodeOS? That would be a good way to get npm working without having to implement or extend a pure Node-based git replacement. piranna commented on Sep 22, 2014 If they are so few commands, why npm doesn't use already a Javascript library? How does it do in Windows if there's no git command available, for example? Shouldn't it be better and easier add it to npm itself instead of add a git command to NodeOS? othiym23 commented on Sep 23, 2014
If they are so few commands, why npm doesn't use already a Javascript library?
I bet @creationix would have a pithy answer to this; it turns out that supporting all of git's transport mechanisms in addition to dealing with packfiles and all of the file-manipulation magic necessary to check out a repo correctly isn't trivial business.
How does it do in Windows if there's no git command available, for example?
It fails miserably. npm on Windows requires Git just as much as it does on Unix.
Shouldn't it be better and easier add it to npm itself instead of add a git command to NodeOS?
We have to pick and choose our battles. Apparently, @isaacs chose the battle where he rewrote his own version of tar from the ground up to handle all of the many, many weird edge cases that can show up in tar files, and that's comparatively simple next to making a functional git client.
As always, though: patches welcome! creationix commented on Sep 24, 2014 Getting js-git to the point that it can be used internally by npm is closer. If someone wanted to take on this task, I could guide them. The main tasks are:
- Clone over HTTPS. The actual clone is pretty much finished, you just need a node adapter to use node's https client (or use http-codec on top of node's tls module).
- Check out files. Since npm doesn't need to create an actual git checkout complete with index, we can just export the files for a given commit/tag to disk. Trivial in current js-git
- Clone over TCP, this is also easy, but only works for git:// read-only urls.
- Clone over SSH. This is considerably harder, but much easier in node as opposed to in browser where raw TCP and TLS are harder to come by. The https://github.com/mscdex/ssh2 module would come in handy here.
As far as tagging and writing to a git database, that's not implemented as a high-level API, but it's pretty trivial to import a directory into git, create a commit from it and tag that commit. You'd still need to shell out to gpg or find a JS implementation for that use case.
Overall I think it's quite possible and just needs someone motivated and with time to finish it. creationix commented on Sep 24, 2014 Also on my list of mad science experiments, fuse for node in pure js and zip for node in pure js. Though if you're willing to bundle node-fuse I have a library that lets you mount a git repo as a read-only filesystem that could be interesting for node_modules. piranna commented on Sep 25, 2014 @creationix, these are great news if it could be so easy! :-)
Clone over TCP, this is also easy, but only works for git:// read-only urls.
Why is that? Shouldn't read-write urls fetched the same way? Only point you can't be able to push... And if you are talking about NPM GitHub repos, it should be managed by npm itself...
You'd still need to shell out to gpg or find a JS implementation for that use case.
Probably these two could be used:
http://openpgpjs.org/
https://www.npmjs.org/package/gpg
Though if you're willing to bundle node-fuse I have a library that lets you mount a git repo as a read-only filesystem that could be interesting for node_modules.
Current Ubuntu kernel has FUSE support, so node-fuse could be added when building the image, it's on the roadmap to be able to install on runtime compiled modules, but it's not easy seems it requires to have installed a toolchain, and we are trying to make NodeOS to be minmalistic and have a small footprint, and install only the required resources when needed by using `ǹpm install``. Could you be able to explain us how the mounted git repo could be used for node_modules?
P.D.: greetings from an old Ubuntu-Tweak user ;-) creationix commented on Sep 26, 2014 When I said "read-only urls" I meant you wouldn't be able to push to the remote, only read from it. This is fine for most npm actions, but npm does write for some things like auto tagging/publishing I think.
The fuse idea is mad science. I wouldn't use node-fuse if you're going for minimal. Implementing fuse in JS isn't that terrible (it's easier than git or zlib). But the basic idea is instead of exporting the files to disk, mount the repos as subfolders under node_modules. This is probably not that good for npm's typical use case though. piranna commented on Sep 26, 2014
When I said "read-only urls" I meant you wouldn't be able to push to the remote, only read from it. This is fine for most npm actions, but npm does write for some things like auto tagging/publishing I think.
AFAIK, npm doesn't write to git never. When publishing, content is
uploaded by simple HTTP POST to npm registry, and in fact there are
published several packages without a repository at all, so I believe
read-only git urls is just enough.
Bower on the other hand, it use git repositories for publishing since
it doesn't have a real registry (bower registry is mostly an url
shortened, said by their developers themselves), but that's another
story.
The fuse idea is mad science. I wouldn't use node-fuse if you're going for minimal. Implementing fuse in JS isn't that terrible (it's easier than git or zlib). But the basic idea is instead of exporting the files to disk, mount the repos as subfolders under node_modules. This is probably not that good for npm's typical use case though.
I would need to see the use case in detail, I don't finish to
understand what you are trying to achieve. But it's true, fuse is
ideal for mad science... :-D
"Si quieres viajar alrededor del mundo y ser invitado a hablar en un
monton de sitios diferentes, simplemente escribe un sistema operativo
Unix."
– Linus Tordvals, creador del sistema operativo Linux creationix commented on Aug 5, 2017 Now to just find time to glue this all together... piranna commented on Aug 5, 2017
Now to just find time to glue this all together...
Take your time :-) Maybe it would be a good idea to commit each one independently so we can review them :-) creationix commented on Aug 6, 2017 I'm pretty busy for the next month with a deadline at my startup, feel free to ping me later if I forget about this. piranna commented on Aug 6, 2017 Ok, I'll try to remember it at end of month, if there's something we can do
during this time don't doubt to ask :-)
[Offtopic] By the way, what's your startup related to? :-)
El 06/08/2017 05:06, "Tim Caswell" < [email protected]> escribió:
…creationix commented on Aug 7, 2017 I'm Director of Engineering at https://daplie.com/. We're trying to decentralize the internet and put ownership of data and networks back in the hands of normal people. piranna commented on Aug 18, 2017
I'm Director of Engineering at https://daplie.com/. We're trying to decentralize the internet and put ownership of data and networks back in the hands of normal people.
I've seen your webpage, the easy to use home server concept sounds cool! :-) bogdanbiv commented on Oct 19, 2017 @creationix: are there any smaller / junior jobs to be done for this remake of the JSgit project?
UPDATE: would it be relevant to create an https://github.com/kripken/emscripten port of https://libgit2.github.com/ (Git library implemented in pure C)?
LibGit2 already has NodeJS bindings, I wonder how hard would it be to replace the calls to the native C library with calls to the EmScripten compiled module. luii commented on Dec 22, 2017 @piranna I've got nodeos-git to compile flawlessly but i get a weird error somehow.
Compilation is totally fine; Startup also; but right after the user init script is run i get
bin/getty bin/logon: "bin/getty" exited with error code 1 its something like this and i tried to find and trace the error but i've found nothing luii commented on Jan 6, 2018 I've cross compiled the nodeos-nodegit package and this resolves the error from above.
@piranna how do i can link nodeos-libcurl against nodegit
because it only says that it needs this but cant find it. I know that nodegit has a flag (-lcurl) in the bindings.gyp file, but can i just say: -lcurl /lib for the libcurl (libcurl.so*) to find it later inside nodeos lib folder? bogdanbiv commented on May 17, 2018 luii commented on May 18, 2018 @bogdanbiv it looks promising i see if i can use it in nodeos-git, because nodegit is somewhat a dead end for me bogdanbiv commented on Jul 17, 2018 Would it help to set up a bounty to get this ready this issue ready? bogdanbiv commented on Oct 9, 2018 Is there a way I can contribute to implementing nodeos-nodegit? I'm not sure how to break down the tasks.
use cases:
Need some research to see how big a subset of the git protocol needs be implemented.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|