neogitorg / neogit Goto Github PK
View Code? Open in Web Editor NEWAn interactive and powerful Git interface for Neovim, inspired by Magit
License: MIT License
An interactive and powerful Git interface for Neovim, inspired by Magit
License: MIT License
Currently various git commands break when nvim is started in a subdirectory under the git repository, due to file paths not lining up with the cwd of nvim.
We'd need to search upwards for the root (or is there a git command for that?) and use that as a cwd for all git commands
When debugging #7 , I realized Neogit constantly falls back to mode 2
after I stage the hunks. I guess the ideal would be to not revert, since one can probably add another hunk from that same file, for example. An alternative would be to make the behavior configurable.
90% of my fugitive use is :Gdiffsplit
, it's the most useful git command (for me) by far.
I would love to see a method for viewing (and stepping through) diffs. Happy to contribute to this if you think it is in scope.
Unrelated but @RianFuro @TimUntersberger do you all actively lurk on our gitter/IRC? I'm a huge fan of this plugin and would like to make sure we're doing whatever we can in core to support your work.
The first
and last
fields are now nil for some reason ??
Hello, it's really a pleasure to see this ambitious project being worked on, being both a VIm and Emacs (at work, not by choice) user and wishing we had something like Magit over here.
I understand this is a WIP project, but after a quick little test I found one small issue. In the status buffer, if and only if the help popup (?
) is displayed, some of the commands emit an error, such as Log (L
):
E5108: Error executing lua ...ano/.data/nvim/plugins/neogit/lua/neogit/popups/help.lua:38: attempt to index global 'popups' (a nil value)
Use case:
Whenever neogit
updates the state of git
, other plugins that deal with git
need a mechanism to be informed of changes. Otherwise, the state of those plugins become inconsistent with the actual state of the project.
For example, vim-gitgutter will still display code as uncommitted when actually it's been committed with neogit
Solution:
Create an autocmd for neogit
that other plugins (or the user) can use to update those plugins. For example: we already have a __NeogitStatusRefresh
function. If we expose that as an autocmd it would allow us to do:
autocmd User NeogitStatusRefresh :GitGutter
to inform vim-gitgutter
that our project state has changed
Currently we don't check if the cwd is a git repo or not, resulting in errors if it isn't
If you notice a feature is missing, please look for an existing umbrella
issue and if one exists that matches your request then comment under the issue.
When starting neogit like this:
require('neogit').status.create('floating')
The status buffer appears correctly, but any popup windows appear in the previous buffer. I don't know how to fix this.
Thanks for your work on this plugin ๐ I'm really excited to see where things go ๐ฏ .
I just wanted to note a bug I encountered whilst using it (I appreciate it's WIP but thought you might want to have this tracked). When calling NeogitStatus
whilst on a branch without an upstream I get repeated command error popups. Looking at the log via $
I see
128 git log --oneline @{upstream}.. --
| fatal: no upstream configured for branch 'feature/multiple-carer-notes'
128 git log --oneline ..@{upstream} --
| fatal: no upstream configured for branch 'feature/multiple-carer-notes'
0 git log --max-count=1 --pretty=%B --
| fix: refetch the token for every request
|
| This prevents it going out of sync when logging out and in to the app as
| different users
128 git log --max-count=1 --pretty=%B @{upstream} --
| fatal: no upstream configured for branch 'feature/multiple-carer-notes'
0 git status --porcelain=1 -b --
| ## feature/multiple-carer-notes
| M lib/services/api.dart
When I run the erroring commands in a terminal it prints
git log --oneline ..@{upstream}.. --
fatal: no upstream configured for branch 'feature/multiple-carer-notes'
I wonder if there should be a check for if there is a valid upstream before upstream related commands are tried? not sure the best way round this based on how this plugin is structured but in this case I don't really think this is a real error in this case since it's expected as I just created the branch and haven't pushed it yet
EDIT: also not sure if it's intended but --
is being appended to all commands it looks like without any further arguments not sure if that's intentional or not
Hello. Please add some demo video or photos of neogit:)
Thanks!
I guess i am not getting this straight. How can i configure Neogit to open in a split, or popup properly?
I created a config file, like neogit.lua
, and put this on the file:
local neogit = require('neogit')
neogit.status.create('split')
But this way, everytime i open nvim, it automatically opens neogit in a split way, as soon as i open a file. And then if i close the buffer, and open :Neogit
again, it opens in the default tab way. So how do i properly configure this to everytime open in a split way?
As a user I would like to see which content can be toggled without having the manually try <tab>
and see which content is open/closed.
The push operation should prompt the user to select an upstream to synchronize the branch to, if the branch does not have an upstream yet.
On that topic, since we've copied over the pushRemote
vs upstream
distinction from magit, do we want to keep going with that?
Just to flag this although it might be a known issue already but whilst using neogit it doesn't read my .gitmessages
from my .gitconfig
. I've set the commit message text to use a different placeholder to match the commit style I use. The screen shot show the commit buffer with vim fugitive and neogit. Fugitive somehow is reading this information whereas neogit doesn't.
It's not a blocking issue at all just worth pointing out.
It would be nice if I could stash unstaged changes the same way I can stage them.
I keep seeing
Git error (128) !
Press $ to see the command history
as notifications.
Not only that but pressing $
does nothing.
Is there a way to suppress these notifications ?
Btw I like your notification system and you may be interested in neovim/neovim#13843
I apologize for the click-baity issue title...
My request is quite specific: Right now, the commit window uses the Emacs mapping <c-c><c-c>
to save the commit message and perform the commit. Coming from vim-fugitive
, I just can't add this to my muscle memory -- I always try to do this with the standard vim mapping :wq
(like in vim-fugitive
).
Can this be (optionally) supported?
This should describe every supported popup and action.
This is probably an upstream bug. Sometimes toggling a diff for the first time can crash neovim when creating the fold
Interesting project. Are you planning/considering to use libgit2? There seems to be nice lua bindings. I was thinking on prototyping my own git integration from scratch, but I could start with your stuff and try to move things over from cli to luagit2. If this sounds interesting.
When in a repo that uses git hooks, commit might not go through. Saving the commit message and reopening it if the last command didn't go through would be good. If it's stored in a file, not overriding the content of the file if it exists (only replacing the commented lines) would solve the issue.
Currently a lot of manual calculations is done to know where each section and so on is. This can be completely avoided by using extmarks.
Having something like the ?
popup in magit for neogit, would be really cool. I keep forgetting about keybindings that I rarely use and then I have to look them up in the documentation. Implementing this popup would simplify these steps and also makes neogit easier to learn.
When I scroll the status buffer with an expanded unstaged/staged file, I see nicely colored changes with a red/green highlight. However, suddenly as I scroll, the red/green turn into a gray color, that is very difficult to read, and the only way to get it back to the nice colors seems to be to scroll far enough so the colored region is more than half way off screen, and then click somewhere outside of that region. Example:
Scrolling down with mouse wheel, and at some point it looks like this:
Hey,
Iโm a using a non QWERTY keyboard layout (bรฉpo) and I need to redefine a bunch of keys (i j k l are redefined and I map them to c t s r, which means that those keys are important to me), so I need to remap things such as stage / rebase.
Is it possible? Thanks in advance.
There's an open pull request at nvim-lua/plenary.nvim#83 that takes the same approach we did with async (with inspriation from us apparently ๐), makes it actually good (they already fixed a few performance concerns I had with my implementation) and adds it to plenary.
Now, I have no idea how widespread plenary actually is, so I have this question to @TimUntersberger and anyone who uses neogit and sees this: If this will be merged, should we actually depend on plenary (and not just for tests) and use their async library?
This would mean users would need to add plenary to their list of plugins if they'd want to use neogit.
Hi there, I'm using the master version on a days-old NeoVim 0.5 and issuing :NeoGit
opens up a new tab with an empty buffer. The various commands listed in the help bring up some other buffers but nothing ever shows up on the NeoGit buffer. ctrl-r
doesn't do anything or bring up an error message.
I'm happy to add more diagnostics if I can find out how to generate them :)
Thanks for putting this out there, I'm currently using vim-fugitive but it's not ideal...
Right now if a notification is still visible and you try to exit the status buffer you get an error that you can't close the buffer because a floating window is still present.
Being able to quickly look at all of the conflicts in a file would greatly improve the merge experience. I imagine an interface similar to the diff view, with additional functionality where needed.
Hi, thanks for the plugin.
Can I ask for a keybinding (like ?
) that shows which keybinding does what? Or maybe just add it to README/doc?
It'd be nice if one could bypass the main Neogit status window by directly entering, say :Neogit commit
(or lua neogit.commit()
) to save some keystrokes.
(In this case, it might make sense to refactor a bit to introduce a setup
function that allows specifying default options like float window, key mappings, etc.?)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.