Skip to content
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

rfc: Add dedicated rebase UI? #81

Open
fmuellner opened this issue Aug 11, 2022 · 5 comments
Open

rfc: Add dedicated rebase UI? #81

fmuellner opened this issue Aug 11, 2022 · 5 comments

Comments

@fmuellner
Copy link
Contributor

Unlike commits, the todo list of an interactive rebase is not free-form. We could therefore do better than just popping up an editor like git does, and instead have a dedicated UI:

Screenshot from 2022-08-11 17-10-34

Does that look like a good idea?

(I'm about to go on holiday, so may have some time for some fun hacking)

@sonnyp
Copy link
Owner

sonnyp commented Aug 11, 2022

I had the same idea but was worried it would provide a lesser experience regarding keyboard navigation, specially if I enable GtkSourceView Vim emulation.

Perhaps it could be a view switcher?

Anyway – I like the idea and would love if Commit could also provide some tooltips to help beginners understand what's going on there.

Related https://gitlab.gnome.org/GNOME/gitg/-/issues/4

@fmuellner
Copy link
Contributor Author

I had the same idea

Heh, I didn't claim it was an original idea :-)

was worried it would provide a lesser experience regarding keyboard navigation, specially if I enable GtkSourceView Vim emulation.

I'm less worried there.

Keyboard navigation of lists is already pretty good out-of-the-box (tab or up/down arrows to move between rows, enter or space to open the popover with the available actions). There is no built-in support for moving rows, but I don't expect that to be harder than shortcuts to move lines of text.

Vim bindings come in handy for stuff like 0cw squash as that's easier than HomeShiftCtrlsquash, but then you don't need either if the only navigation you need is up/down.

There's one thing I hadn't thought of: Moving a group of commits. That can currently be done by selecting multiple lines and using the shortcuts. I don't see an obvious GUI replacement :-(

Perhaps it could be a view switcher?

Mmh, that would certainly complicate things (not just in terms of UI).

With a GUI-only approach, you just have to parse the todo once to create the UI, and write out the final state if the rebase is confirmed.

A view switcher requires to have both a text buffer and a list, and keep both in sync (in either direction, as changes to the text buffer should be reflected in the UI and vice-versa).

@sonnyp
Copy link
Owner

sonnyp commented Aug 11, 2022

Heh, I didn't claim it was an original idea :-)

I meant it in a way that I also thought it was a good idea 🙌

A view switcher requires to have both a text buffer and a list, and keep both in sync (in either direction, as changes to the text buffer should be reflected in the UI and vice-versa).

I'm happy to implement that later or fallback to a preference.

Let's default to the GUI anyway 👍

@oleastre
Copy link

Hello, I've just gone through a big rebase today, and while it's easy to reorder commits, it's quite not easy to replace a pick with a squash, reword, edit, ...
I had a look at the keyboard short cuts hoping to have some rebase specific one there, but without luck.
A quick win for me, that would not need a big UI change, would be to have shortcuts that just replace the first line word with an other one. for example:

Ctrl+p => pick
Ctrl+s => squash
Ctrl+e => edit
Ctrl+r => reword
Ctrl+d => delete

If multiple lines are selected, loop over each line and apply the same replace strategy.

@coreyberla
Copy link

Another somewhat related complication is that "Abort" appears during an interactive rebase, which is confusing to me because clicking "Abort" doesn't actually abort the rebase. Not sure if it makes sense to changing the wording globally or just in a separate rebase window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants