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
{{ message }}
Repository navigation
Include a git distribution, as many packages on npm depend on it #67
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...
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.
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.
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.
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.
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.
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?
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.
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.
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.
@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.
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?
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.
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
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" <notifications@github.com> escribió:
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'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! :-)
@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.
@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
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?
Activity
piranna commentedon 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 commentedon Sep 17, 2014
@piranna see here. npm allows git dependencies, but requires a
gitcommand as an external tool in order to fetch them.piranna commentedon 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 commentedon 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 commentedon Sep 17, 2014
It's not a bad idea...
groundwater commentedon 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 commentedon 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, andgit tag(with support for calling out togpg --sign), but lots of different kinds of git URLS, lots of permissions logic, etc.dbkaplun commentedon Sep 22, 2014
Would it be possible to package
gitas 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-basedgitreplacement.piranna commentedon Sep 22, 2014
If they are so few commands, why
npmdoesn'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 tonpmitself instead of add a git command to NodeOS?othiym23 commentedon Sep 23, 2014
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.
It fails miserably. npm on Windows requires Git just as much as it does on Unix.
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 commentedon 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:
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 commentedon 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 commentedon Sep 25, 2014
@creationix, these are great news if it could be so easy! :-)
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...
Probably these two could be used:
http://openpgpjs.org/
https://www.npmjs.org/package/gpg
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 commentedon 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 commentedon Sep 26, 2014
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.
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
149 remaining items
creationix commentedon Aug 5, 2017
Now to just find time to glue this all together...
piranna commentedon Aug 5, 2017
Take your time :-) Maybe it would be a good idea to commit each one independently so we can review them :-)
creationix commentedon 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 commentedon Aug 6, 2017
creationix commentedon 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 commentedon Aug 18, 2017
I've seen your webpage, the easy to use home server concept sounds cool! :-)
bogdanbiv commentedon 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 commentedon Dec 22, 2017
@piranna I've got
nodeos-gitto 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 1its something like this and i tried to find and trace the error but i've found nothingluii commentedon Jan 6, 2018
I've cross compiled the
nodeos-nodegitpackage and this resolves the error from above.@piranna how do i can link nodeos-libcurl against nodegitbecause it only says that it needs this but cant find it. I know that nodegit has a flag (-lcurl) in the
bindings.gypfile, but can i just say:-lcurl /libfor the libcurl (libcurl.so*) to find it later inside nodeos lib folder?bogdanbiv commentedon May 17, 2018
@luii, @piranna Stumbled upon this link on hacker news: https://isomorphic-git.github.io/ - A pure JavaScript implementation of git for node and browsers!
Is this good enough for milestone 1.0.0 - /issues/37 ?
luii commentedon 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 commentedon Jul 17, 2018
Would it help to set up a bounty to get this ready this issue ready?
bogdanbiv commentedon 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.