-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Requires git #260
Comments
It wouldn't really be a git wrapper then though, would it? 😉 |
No.... hmm..... "Ungit: worlds best git client" |
@gravypod yup would be awesome to get rid of that dependency, but I afaik there's no good replacement right now. Some of the stuff I've been looking at:
And there's also a bunch of other libraries with either limited functionality or limited activity :( |
You are not seriously considering this, are you? oO |
@Profpatsch well I'm not considering writing my own git implementation no, but if any js implementation of git becomes stable enough I might switch to that yes. |
@FredrikNoren Have you seen this library? https://github.com/creationix/js-git |
@gravypod yup but last time I looked it was missing some functionality for me to be able to use it straight off (don't think it supported creating patches/commits from a "dirty" working directory). But it looks promising otherwise. |
@FredrikNoren If you want some help cleaning it up I could help pitch in. We should get in touch via Email or IRC, which ever is better for you. |
How can you be sure this won’t screw up my repository? But this git-js is nothing of the above, not even very usable. So who (or what) guarantees that this won’t seriously damage valuable git repositories? |
@Profpatsch Lots of testing, testing, and more testing before merging it into the master |
@gravypod Thanks but I don't think I'll be trying this any time soon, as @Profpatsch pointed out it might be a bit early for that. Though by all means help creationix with his project, would be awesome if it became stable (and feature complete) enough for me to use it in ungit |
https://github.com/creationix/js-git seems to be coming alng well. I wudl like the option to use this library. the reason si that we have many people that are non technical and they are using ungit to be able to edit content and a bit of js and they need to push to the git branch, and then the github hooks to an auto deploy. so it would be useful to use because having their machines (windows) setup to run node-gyp is a nightmare to maintain this is why it would be great to have a config setting with ungit to allow the user to target the normal git binary Or the git.-js version. |
I guess that’s why we can’t have nice things. |
funnily enough i just found an extension for brackets that doe the job well. https://github.com/zaggino/brackets-git so far works very well for basic work flows. |
I just found this, thought it might be fun to drop it off: http://gitlet.maryrosecook.com/ |
So yeah. Not really something we could actually use, but still interesting. |
From the Readme:
So, not a JavaScript implementation of git. Just another wrapper, just like ungit is. |
Gitteh sounds like the obvious choice. @aspiers has a similar project over at aspiers/git-deps which uses libgit2 via the python bindings. As long as you want to work directly on disk-based Git repositories, I don't think js-git is the right thing. |
Gitteh looks interesting, but doesn't provide all the features necessary for ungit yet. From their README:
|
@Ajedi32 Sorry, I simply assumed that Gitteh was a thorough implementation |
@tfnico Yeah I think you're right (about nodegit). It also looks like they are making some fairly good progress. @tbranyen @johnhaley81 @maxkorp (maintainers of nodegit): do you guys have any input on the feasibility of using nodegit for ungit? To give you some background (if you are unfamiliar with ungit): ungit is a UI, built on top of the git cli, which means that you have to install git to be able to use ungit, which is why we are interested in projects such as yours so that users can use ungit without having to install git first. (Lots of "git" in that sentence but I hope you get the idea :) ) |
Nodegit is getting better everyday. I'm not going to come out and say that we're stable and ready for prime time right now but we're getting close. We're striving for 1:1 mappings to libgit2. Next release for us is going to be 0.3.0 which will have us using the latest on libgit2 (0.22.x). So what you'd really to ask yourselves is "Does libgit2 provide everything we need". And if it does then we will fit the bill soon. In the meantime there are always pull requests :) |
Adding to what @johnhaley81 said regarding pull requests, you have to decide what your comfort level is adding features. There are a few tiers of complexity there. Short version: Long version is at the bottom. Heres the long version of adding features:This was all way longer than I intended to write, and sounds much worse than I want it to (or than it is), just because explaining the hard parts of when things arent missing takes a lot more talk than explaining how easy fixes work lol. If it doesn't exist in libgit2, and is an appropriate addition (more on that in a bit), you'll have to do work in there. I know some people love C, and I don't hate it, but I don't know many that consider it easy to or quick to work with. If libgit2 does have a feature (fresh addition or not), there are two ways adding it to nodegit can go.
If the feature isn't really appropriate for libgit2 (eg it's high level), we have convenience methods added in javascript. libgit2 is a very low level library; You don't tell it to pull a repo, you tell it to get the repo, open it, grab the head reference, get its OID, use that to get the branch name, grab the repos remote, tell it to download (fetch basically), grab the remote branch's OID, set the local branch to that OID, and then set the head ref back to that. We add a lot of convenience methods here, but many are missing, and once you understand how it works these are easier to add. There's also an opportunity to add things that libgit could/would/should support here temporarily using some workarounds, and that's ok, as long as an attempt is made to make the api similar to what one would expect. |
@johnhaley81 @maxkorp Thanks for really good and detailed answers! Yeah Ungit is very high level, it's essentially just a UI on top of the CLI, and actually one of the things we've tried to aim for is to make it as close as possible to the CLI so that even if you first learn git using Ungit you may be able to move to the CLI later and at least have a rough idea what things do. (There are obviously quite a few discrepancies but overall I hope Ungit helps people understand how git works). So with that in mind it does sound like it would be quite a bit of work to switch to nodegit/libgit2, and especially guarantee that you can move seamlessly from the CLI to Ungit (which is very important to be able to do for those few times when you have to use the CLI to fix things). Anyway I think it would be great to stay in touch, for instance if you guys (or someone building on what you guys are building) were to supply higher level API:s that closer match the CLI we would be really interested in hearing about that. |
We are definitely planning a higher level library of nodegit once we get it stable. That project would be more trying to mimic what the CLI is doing and have a very similar interface. We don't have a timeframe on that at this point however. :( EDIT |
Cool that's good to know! Thanks! |
I’m very sceptical about replacing git in a git client. Compare: https://www.openhub.net/p/git https://www.openhub.net/p/nodegit |
@Profpatsch Well, nodegit is just a bunch of bindings to lib2git, which is written in C, and pretty mature. https://www.openhub.net/p/libgit2 And honestly, nodegit itself is extremely mature compared to Ungit, so I'm not really sure what the problem is. |
@Profpatsch 2 points:
I'd also point out that 90% of nodegit's code (that isnt libgit2 code) is actually C++, not JS. |
Ah no, thats libgit2, not us, but that has a massive support network, and their entire function is parity with git proper, although like I said, it's not there yet. They do a great job of keeping the features they do have at full compat though. We just wrap it, and make it accessible to JS ;) |
See GitKraken, it's made out of electron + nodegit which only needs libgit2 has a dependency and has become more robust and complete since the last year. So I 👍 for https://github.com/nodegit/nodegit too. |
I'm glad that this might happen and that there is now a mostly feature compliant replacement for git. |
As a git lover, I'm hesitant to do this, but at the same time I understand the use cases for this. I really wish we could do polling here but will it be better if ungit does some hybrid approach where if git exists, use git, otherwise use whatever git replacement. Would that be a better solution or are we asking for complete independence from git overall? |
What would be the the point of continuing shell out to git when available if we had an interface to libgit2 working? Is there any particular benefit to using the git CLI over nodegit? |
Every time crucial dependency of a project is replaced, it was never fun... so I guess I'm just very hesitant... But I admit that scale of ungit is not as big as some of the projects I have worked on so my concern is largely unfounded.... |
This sounds paradoxical, removing bare bone git dependancy from ungit. I guess nowadays git outgrow tool realm and became more like protocol. Honestly I don't imagine using dev machine without one or the other. |
I have started to play with nodegit (https://github.com/ylecuyer/ungit/tree/nodegit) if someone wants to help it would be nice :) |
I'd like to update this issue: node-gitteh (by the libgit2 team) is no longer being developed, and nodegit is now using libgit2. https://github.com/git-up/GitUp (macOS only) is using libgit2 to great effect: it is way faster than calling git, and it does some very neat rebase actions like moving a commit, splitting a commit etc, while marking previous refs as undo points, making everything undoable. Ungit is the only client I could find that is close to the overview GitUp provides, and since I'm no longer on macOS I'm really happy I found it 👍. Moving away from calling git directly can make Ungit faster and better. |
At the time I tested to use nodegit directly, it wasn't mature enough to handle all the use cases required by ungit. I also tried to make another git-api backend using rugged instead but it is a lot of work and some advanced actions like merge, rebase, ... are not easy to replicate |
@ylecuyer I rebased your branch: https://github.com/wmertens/ungit/tree/nodegit |
The only problem I have with this project so far is the requirement for Git to be installed. If you wrote your own implementation this project would surpass any other git wrapper I have ever seen.
The text was updated successfully, but these errors were encountered: