-
-
Notifications
You must be signed in to change notification settings - Fork 619
Git Actions #2474
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
Comments
This comprehensive solution might help you out: Git Stage Unstage Files And Directories From The Tree I'm using a (dumber) approach for git operations, mapping this one to local function git_unstage()
local path, dir = node_path_dir()
if path and dir then
vim.fn.system({ "git", "-C", dir, "restore", "--staged", path })
end
end Changes to |
I'll investigate a git wrapper however I can't promise anything. |
@alex-courtis For a low-cost solution, you may peek wrappers at (it would be best if all maintainers unite to create unified api):
It's nice to have htis for paths; I usually stick to gitsigns to stage hunk-by-hunk |
Unfortunately we can't practically move to libgit2 lua bindings as it requires native compilation. Almost no plugins use that due to installation dramas. It could be an optional implementation for power users. |
It would be sensible for many git plugins to use a single abstraction layer. That would be a large task... |
I'm not asking for that. I'm requesting a feture that would take renaming into account in git, so git kees track of it. It's totally fine if we go with something like |
I've changed title back. It's all about using git for renaming. Whether to use dedicated libraries or terminal git command or not - is up to implementer. |
We do have a mechanism for renaming - the recipe. A git executable call is the only "API" that git provides. Is there an issue with the renaming? The git watcher should pick up changes immediately. |
It's a feature request. Currently if you rename a file by using It would be nice if |
I see, no. The tools are there, you just need to implement it yourself: as a mapping, or an event handler. This would be a great opportunity for an extension plugin: https://github.com/nvim-tree/nvim-tree.lua/wiki/Extension-Plugins |
It won't unless |
FeatureAPI additions to allow git mutation. These may be mapped by default.
Prior ArtAlternativeScopeFugitive is stable and mature and interacts seamlessly with nvim-tree. Its mutation feature set would be safe and sufficient. |
Well, even if we make an extension, we can't hook into default |
See #2551 (comment) |
nvim-tree.lua/lua/nvim-tree/actions/fs/rename-file.lua
Lines 23 to 40 in aaee4cd
Describe the solution you'd like
The
e
andr
don't respect git repo: by renaming something we loose track of file path history. I would like to be able to rename filepath by usinggit mv
(instead of system command) in order to keep track of file renames:Currently,
nvim-tree
doesn't provide this feature forcing me to rename file by using git manually.Describe alternatives you've considered
Running
!git mv % <path_no_new_name>
is rather clunky...Running
!git -A <path_no_new_name>
is rather clunky and not something I want...Can this functionality be implemented utilising API?
NO.
Additional context
I'ts difficult to easily contribute API feature, cause:
status
git
wrapper for running & handling git output (there is a dedicated fast libgit2 lua bindings btw)nvim-tree.git
is unclearThe text was updated successfully, but these errors were encountered: