-
Notifications
You must be signed in to change notification settings - Fork 141
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
Discussion: keybindings to support more functions? #259
Comments
I do like this functionality and think it would be a great addition. That being said, I think we should stick to the obvious git commands for each scenario and allow adding esoteric ones via variables as you did. E.g. I would consider |
Just spitballing here, instead of having
That may fit more into the current design of forgit, and not add a possibly hard to remember shortcut for our users (that may be mapped to other things. the current An added bonus is that |
Hey @cjappl, thanks for your opinion here. A few points from my side on that:
That being said, no matter if we integrate the keybindings into the upstream |
Yeah I see your points for sure @carlfriedrich. I think the "maintain backwards compatibility" argument is the strongest, we shouldn't break bwc lightly.
Let me give your config a try for a bit and see how it feels in practice.
100% agreed on that one. That's why we're all here working on it together 🎉 Thanks for the thoughtful responses. Interested to hear what @wfxr thinks, and I'll report back when I have some soak time with your configuration. |
Wow. Just used this config for the first time and I have to say it's extremely nice. Worked exactly as intended, easy to customize to new keybinds. I guess my only hangup for mainlining this to forgit is "this is very different than anything that forgit does so far, is that ok??" Some ways around that question would be:
Or we could just say "hey this is nice, let's just do it. Again defer to @wfxr when he is available. Overall very very useful. Will be using it locally for the foreseeable future @ |
@cjappl Great to hear that you like it. :-) Yes, you are right, it will be a new kind of feature for forgit. Again some thoughts on that from my side:
Commit list
So we could add the lower four as keybindings in Changed files list
Here we could add the lower two as keybindings in Branch list
For this list we don't have a "viewer" function, so we could add a |
(Haven’t forgotten about this, need to look with fresh eyes after the holiday. Happy holidays and happy new year everyone!)
…On Wed, Dec 21, 2022 at 12:34 AM, Tim ***@***.***> wrote:
***@***.***(https://github.com/cjappl) Great to hear that you like it. :-)
Yes, you are right, it will be a new kind of feature for forgit. Again some thoughts on that from my side:
-
Adding it to the README is something I would consider as well. But since this change only adds something and doesn't change any existing behavior, do you think that there are people who will actually be disturbed by it? Otherwise, from a user's perspective, I don't see why we shouldn't directly add it to the code instead of only to the README (current issue [#265](#265) shows that people obviously don't even read a single line of the README).
-
If we're adding this as a feature, we should apply it to other forgit functions as well to make the feature set consistent. The following forgit functions all present the same list:
Commit list
- forgit::log
- forgit::rebase
- forgit::checkout_commit
- forgit::revert_commit
- forgit::fixup
So we could add the lower four as keybindings in forgit::log (that's actually what I wanted to configure in my personal setup next anyway).
Changed files list
- forgit::diff
- forgit::add
- forgit::checkout::file
Here we could add the lower two as keybindings in forgit::diff.
Branch list
- forgit::checkout::branch
- forgit::cherry::pick::from::branch
- forgit::branch::delete
For this list we don't have a "viewer" function, so we could add a forgit::branch function (gb?) which adds the above three functions as keybindings.
—
Reply to this email directly, [view it on GitHub](#259 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/ADMDXY3BJMGSROQCTTT3DA3WOK6INANCNFSM6AAAAAAS4HBFMY).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Alright I'm back. I definitely see all your points, and like the idea of making things consistent (some command for doing things with stashes, one for commits, one for branches). Makes sense to me. Definitely want to hear @wfxr opinion on it. I also have something in the back of my head that is on the fence about it. I personally like the flow of "look at something with 'glo' then act on something with a "verb" like 'grc'. The paradigm that we have been using so far. I'm wondering if the gain in functionality of this change is worth the extra maintenance burden etc, as well as shifting the paradigm. This is basically adding a second way to do a lot of things - is that a DRY violation? I worry about 'forgit' trying to become a swiss army knife, and having too much functionality not used by everyone, everyone with different configs running different versions of the same commands that we have to support Maybe this worry is overblown, but I can't help but to think about it. That is absolutely not to say this isn't nice to have, I just worry about implementing a "second interface" for a lot of core commands. What do you think @carlfriedrich ? |
Why not have all the keybindings available for all the commands in their respective group? I think this would make it even more consistent and also more flexible in certain situations. E.g. When I stage files, I often find some files that I've made changes on which are no longer necessary and I want to checkout those files instead. Having the ability to checkout files in |
@cjappl I don't think that the maintenance burden is as huge as you might think. What would we have to do?
The functionality is already implemented, as we already have everything in the forgit functions. We can share the code for each keybinding with the according forgit function. This requires some refactoring, but it would keep the code DRY.
@sandr01d Yes, we can definitely do that. |
@wfxr Very curious about your opinion on this. Would appreciate if you find a few minutes to comment here. |
@carlfriedrich I'm very sorry, it's been hard for me to maintain the project recently. I think your idea is great. I only suggest not to list the shortcuts on the prompt. Maybe we can use readme and/or release notes to introduce these features. Another option is to allow the user to configure whether to display these shortcuts in prompt line. @carlfriedrich @cjappl What do you think? |
@wfxr No worries, thanks for your input! Do you want the shortcuts not in the prompt or not visible at all? An alternative would be to use fzf's I think that would be cleaner. Would you prefer that? We can still make the display configurable, though. And of course we will add the shortcuts to the README. |
Cool! I'm all for it if you all are down 😀 I have found the original git stash adjustment quite useful. I have no strong opinions on the prompts being on the top or bottom. I do like having them displayed though, to remind myself which is which. I suppose in a later commit we could have a variable that turns them on or off (but not necessary for v1 IMO) Let me know if you need help implanting @carlfriedrich ! Otherwise happy to review and test |
@carlfriedrich |
Great, thanks for your feedback everyone! I will prepare a PR as soon as I find time for it. Might take a while, though, since I am quite busy atm. |
Just a quick heads-up on this: unfortunately implementing these shortcuts are harder than I thought, mostly because we eventually have to reload the input list for |
Check list
Environment info
Problem / Steps to reproduce
This came up during a discussion in #251.
fzf
supports a list of possible hotkeys that can be bound to custom commands and then be called on list items while browsing them. I personally make use of this in mygss
selector by defining these options:This makes the stash selector look as follows:
I can now view, apply or drop stashes all from within the same stash list.
I kind of "hijacked" the fzf prompt to display the available keybindings. Something similar could be achieved passing
--header "[ENTER] show [ALT+ENTER] pop [ALT+BACKSPACE] drop" --header-first
tofzf
, which might be a bit cleaner. I just found putting it into the prompt visually more appealing.@cjappl @sandr01d @wfxr
How do you like this? Can you imagine including this kind of functionality into forgit? We could make use of this in other forgit dialogs as well, e.g. keybindings in
glo
for reverting the selected commit or starting a rebase on it.Let me know what you think.
The text was updated successfully, but these errors were encountered: