-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[experimental] feat(commands): git-log picker #4984
Conversation
Can I help in testing it as you progress? |
@Proful yes please, feel free to. This should already be functioning as it is to some extend but the implementation is in very rough early state. I will mostly want/need input from @pascalkuthe (if you find some time for me please, mostly architectural questions) and also importantly, I would like to know how far we want to go with vcs/git integration and what should be left to plugins eventually (cc @archseer). I think this will need split into 3 PRs: one for picker refactor/new kind of picker, one for VCS registry refactor, and one for this log picker itself. I would also like to keep this PR as small as possible so I think the scope of this PR would could be kept at commit preview - without picker action, etc. which could be implemented in follow-up PRs. |
Looking great!! Minor observation:-
The below suggestion is too early. But it would be great to see something like this in future |
e0590ee
to
c99c17d
Compare
c99c17d
to
7925b93
Compare
A commit picker will require a more sophisticated design than the approach in this PR. This PR walks all ancestor which can quickly become quite slow for larger repos. The reason normal Herein lies another problem. This PR fuzzy matches on all commits in a repo on every keypress (and blocks the UI on that). Just for reference a A workaround for a For fuzzy matching another shortcoming of this PR is that is sorts the matching by their fuzzy match score. This brings me to the next thing. While I like the basic idea of reusing the picker UI what you implemented here has no actual usecase besides looking pretty. The same thing could be achieved by just opening gitui or I can still think scrolling the history instead could be useful tough when you do not know what you are looking for exactly. That brings me to UI. When I tried this PR the picker was first populated with a printout of the commit however when I started typing it got populated with the hashes instead. This is disorienting the picker contents should always remain the same. Furthermore I think the UI could be improved. I think we could take inspiration from For helix I think the picker should be more condensed. Perhaps You choose something that is very challenging to implement (and doesn't quite have a use-case in helix yet). I would love to see this implemented well |
I think LazyGit is the ultimate UI for git in the terminal and there is no point in trying to compete with it. You can use a terminal with window splitting and open it next to Helix, job done. There are some git integrations that would really work in Helix and can't be done in another window, for example the git gutters. I don't think there is any need to add a lot of git integration other than what can't be achieved with other tools. There is already a discussion on this subject: #4193 I think these are the two most popular TUI git tools: https://github.com/jesseduffield/lazygit |
As I mentioned above integrating a history just for the sake of showing the history is not really useful. However for |
diff without proper syntax highlighting on that screenshot looks suboptimal to me. |
LazyGit optionally uses Delta which lets you choose your own theme for syntax highlighting based on bat. I am using the VS Code one, it is not very close, but others should be better. |
i could probably configure it somewhere close to my custom helix theme, but the point is - we are diffing (and staging!) code, we should see it as is most natural == same as we see it in our editor of choice, ideally in the editor - this is what i call ultimate UI. |
I'm unsure about re-implementing magit into helix, it's better suited as a plugin, or we'll end up with mercurial/svn/darcs/… there in it as well. |
This PR is not about reimplementing magit. I get that the discussion is sort of drifting in that direction but I don't think there is anything to be gained from that kind of general discussion on a PR. It just ends in endless back and fourth. I believe we should evaluate every feature on it's own and determine if it's something we want in helix. The main merit is here:
In my opinion a commit picker will be useful for side-by-side diffs to make selecting the commit we diff against ergonomic. Offering an (optional) linear history mode for that picker would be a good convenience feature so I do think this PR would fit criterion 2 (although not in it's current form see my comment above) |
I am turning this into and issue: #5292, let's continue this conversation there. This PR is as far from ready as it gets (as mentioned by @pascalkuthe) and re-opining a new PR at later point once we are closer to being able to support the commit picker seems ineviatble. |
[experimental, wip]
Add git-log command that opens picker with git commits and their preview.