helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
33.68k stars 2.5k forks source link

[Feature] Git actions #5166

Open otavioschwanck opened 1 year ago

otavioschwanck commented 1 year ago

Would be awesome to have git actions on helix like:

On File:

Harder to do, but would be awesome:

Globally:

kirawi commented 1 year ago

Partial duplicate of https://github.com/helix-editor/helix/issues/4974

pascalkuthe commented 1 year ago

On File:

preview hunk revert hunk stage hunk

There is already #4974 for reverting a hunk that should be pretty easy. Staging would probably work by writing to the git index (with a more generic diffput command) altough there are a ton of unanswered questions in the implementation of that. A hunk preview could be covered by a quick way to toggle side by side diffs (#405).

Harder to do, but would be awesome:

file history (navigate between commits on file, see difs, etc) time machine - go back on time on the file, like https://github.com/emacsmirror/git-timemachine

That is actually easier to implement (except if you want side by side diffs) but I am not sure if this is a good fit for core. These might be better delegated to plugin or external program.

Globally:

Search git changed files

I think this is better covered by adding a vcs status indicator to the file picker (#5116). If a letter indicator is used there as in ( #5110) you could use the existing picker functionality to filter by the kind of change. I prefer filtering in the picker to separate commands as I forgot to type those/don't have them bound to a key bu default.

I would like a per buffer/global hunk picker tough which could be really handy for code review (especially if you could specify a commit as opposed to using the stage)