-
-
Notifications
You must be signed in to change notification settings - Fork 278
Add log margin popup #1715
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
base: master
Are you sure you want to change the base?
Add log margin popup #1715
Conversation
Yeah, for the time being, actions seem like the correct way to build this. The auto-close thing is not always ideal - for a while it wasn't an issue, but this isn't the first time it's been a limitation on desirable behavior. Maybe I can do something about that. Overall this looks very reasonable to me! |
Okay, I think I figured out why the help popup test was failing. I also added a test spec for the margin popup. Hopefully we should be good now! |
Also had to change the help popup slightly: because columns are calculated dynamically, adding an entry for the margin popup changed the order of some of the existing entries.
OK, now we should be good. I think whatever was causing that branch popup test to fail was solved in one of the recent commits to master. Just did one last force push to get rid of an unintended merge commit. Thanks for bearing with me! |
Ah, no worries, I'm always happy when people contribute :) The branch popup test is a bit flakey, no worries there. I'll look at it some day.. maybe. 🤣 |
I've been taking another look at this this week, and implemented two of the arguments: order (topo, author, or commit), and showing/hiding refnames. In the process of doing so, and while following your suggestion of implementing these arguments as configs, I noticed that the status buffer automatically refreshes when changing configs in the margin popup. I am now wondering if the actions we have so far (date style, margin visibility, etc) would be best implemented as configs. This would be a weird in-between, as far as following Magit's behavior: it would be closer to Magit in that we'd be able to cycle through the configs without closing the popup, but farther in that the popup would look very different. If you want to see what that looks like, check out this branch on my fork. What do you think, @CKolkey? IMO, having everything as configs feels nicer to use, but I'll defer to what you think is best! I've also taken a shot at the shorststat and graph toggles, but I think it would be better for these features to be on different PRs. The shortstat is pretty much done and seems to work okay, but I haven't stress-tested it on a large repo. I pretty much just copied Magit's implementation, which they describe as "experimental and rather slow". The graph will be a doozy, since it would require adding support for printing empty lines (for graph connectors, as in the Log view) in recent commits. Both these features seem a bit more complex than what we have so far, which already serves users who just want the basic functionality of showing author names and dates. |
This is another attempt at adding author (and date) information to recent commits in the status buffer (#652), following #653 and #654.
What currently works:
I tried to follow Magit's default behavior as closely as I could. For the ISO-like date, I added a field to
lib/git/log.lua
to retrieve the commited date as a UNIX timestamp, which was then rendered in the local timezone. I think that should be fine, but if that introduces peformance concerns, or if there is a cleverer way to do this, I'm happy to change this.What doesn't work yet
Pretty much all of the other features. Most notably:
I wanted to put this out here for preliminary feedback, but I still need to write some tests before this is ready to merge. After that, I'm happy to work on the missing features, be that before or after merging this initial implementation (maybe after, judging by the discussion in #653?).
A question
I used popup actions to implement the three features above. This was the closest Neogit correlate I found to mimick Magit, but I'm wondering if I have this right.
I think what's tripping me up is that these features seem more like switches than actions proper (for instance, these "actions" don't spawn any new buffers or popups), so mayble internal switches would be better here. Actions also seem to always close the popup, whereas the margin popup stays open in Magit (though we may also opt not to follow Magit's behavior). I may be overthinking this, but it was something I thought I should check anyway.
Happy to hear any thoughts on this; this the first time I've worked on a Neovim plugin, so any feedback is much appeciated!