-
Notifications
You must be signed in to change notification settings - Fork 14
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
Save via git #114
Comments
Actually, rather than being a good candidate for an out of the box feature, I think this is a good candidate for an example evcxr script, because I want to add Rust scripting to both our headless mode and graphical mode. I hope to end up distributing example scripts in It'd just require hooking into the save hook and calling a shell command. Very simple example script. |
I don't object to this, but I also think it will be very slow. |
Which part of that suggestion do you think would be slow? Ironically even pre-compiled Rust using library calls to libgit2 to manipulate repositories is slower that shelling out from Rust to the system |
Fred and I talked about this recently, and we're going to make this our first plugin. It's a good candidate for that as it's going to have to hook into a lot of places we're going to want to expose to the plugin system, and it's relatively uncomplicated. There is a consideration to be made on the shell script end of things is that it requires git in PATH for Windows users. Does libgit2 also require an executable in PATH or is that functionality built-in to the library itself? |
Anything built with Given that such a plugin will probably not need to trawl through history, the library route is promising. But I don't know how well that will play with plugins being "scripts". Will such a plugin have access to a precompiled library so it can use the API? Or will adding the plugin require a Rust toolchain? In that case a plugin that shells out to the system and doesn't require any building might be better. |
That's a really good point I hadn't considered. If this is going to be an eval'd plugin that runs from a script instead of precompiled there'd be no way to include libgit2. Thinking more about it having git in your path is not a terrible requirement for Windows. Someone using git probably already has it from the official git installer, and if they don't they're a download and hitting "Next" about 10 times away. We could even check for Windows and just display a pop-up with customized text for the platform on Linux tell the user to install git from their package manager, and on Win/Mac link to the appropriate binaries. |
If I'm understanding correctly, the only way it could be done with the library and "script" plugins is to make access to all the necessary libgit2 functions into the app (even though unused) and hence expose them, no? I don't even know if that's possible, and if it is it might not be worth it. As you said having system |
Uh, I was thinking of making the script just require that the system have a |
What's the status of this? :) |
The use case logic is sound: if you don't have Git on your system anyway you likely don't need this feature at all. But the implementation is another matter: the That being said the |
While writing #103 (comment) I was reminded that most editors with good plugins get a "replace save() with git.commit()" plugin, and it's possibly so useful to be a good candidate for an out of the box feature.
Lmk if you want links to prior art, but it's a fairly simple concept.
Still, it can go deeper, such as adding auto save with auto commit message, dialog to capture commit messages, advanced UI for file and even line selection, stash, branching and tagging, push/pull.
Possibly this is related to the inotify hot reload of UFO stuff, since checking out another commit will trigger that, etc
The text was updated successfully, but these errors were encountered: