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

commmit - enhance docs for keybinding 'c' for local branch #3046

Merged

Conversation

smangels
Copy link
Sponsor Contributor

@smangels smangels commented Oct 2, 2023

- closes jesseduffield#3030
- mention that it supports '-'
- fix documentation and builtin help
@peppy
Copy link
Sponsor

peppy commented Oct 3, 2023

I don't understand what this addition means, so probably needs to be worded differently.

@smangels
Copy link
Sponsor Contributor Author

smangels commented Oct 3, 2023

I've added what we've talked about in the PR, explaining that the "checkout" local branch dialog supports the '-' as well.

@peppy
Copy link
Sponsor

peppy commented Oct 4, 2023

Aha, I see. Maybe reword to Enter "-" to switch to last. Although I find this UX weird and think a better path would be adding proper support for this.

Generally i just hit Down Space in the branch view to checkout the last branch. Might be a good alternative to this.

@mark2185
Copy link
Collaborator

mark2185 commented Oct 4, 2023

Although I find this UX weird

It's not that weird if you look at it from the git lens, since running git checkout - switches to the previously checked out branch.

@peppy
Copy link
Sponsor

peppy commented Oct 4, 2023

It's not that weird if you look at it from the git lens, since running git checkout - switches to the previously checked out branch.

Yep, for sure. But when using lazygit I'm generally not thinking in git CLI terms, which is why I use the down-space method instead

@jesseduffield
Copy link
Owner

Given that we're considering changing the default to sort branches by commit date rather than checkout recency, it would be good to have a committed key for this. The question is: what key? Not at my keyboard right now but Ctrl+c could work if it's not already taken

@smangels
Copy link
Sponsor Contributor Author

smangels commented Oct 4, 2023

I've adjusted the text according to received review comments. Personally I've assigned the dash to switching when being located in "local branch" scope.

@smangels
Copy link
Sponsor Contributor Author

smangels commented Oct 4, 2023

Given that we're considering changing the default to sort branches by commit date rather than checkout recency, it would be good to have a committed key for this. The question is: what key? Not at my keyboard right now but Ctrl+c could work if it's not already taken

Good question, the distance from CTRL key would be worth considering as well. Words worth considering are

  • recent
  • previous
  • latest
  • switch-back
  • swap

and derive characters from them?

@peppy
Copy link
Sponsor

peppy commented Oct 4, 2023

Very subjective, but I use the "`" key for "last" things in my own keyboard schema. I think this comes from macOS' cmd-` for window switching..

@jesseduffield
Copy link
Owner

Backtick currently toggles tree mode in a files view. I can imagine in future having a tree mode in the branches view where e.g. branches prefixed with feature/ get grouped under a feature/ node (some git GUIs do this by default). So backtick is off the cards.

I'm leaning towards '-'. There's a chance somebody will press it in the attempt to shrink the current window but I do think it makes a lot of sense as the keybinding given that it's the argument you pass to git checkout. Thoughts?

@jesseduffield
Copy link
Owner

(Also it just occurred to me that my earlier suggestion of ctrl+c makes absolutely no sense because that's the universally understood way of quitting a terminal application. One day I'll stop publicly embarrassing myself haha)

@smangels
Copy link
Sponsor Contributor Author

smangels commented Oct 5, 2023

(Also it just occurred to me that my earlier suggestion of ctrl+c makes absolutely no sense because that's the universally understood way of quitting a terminal application. One day I'll stop publicly embarrassing myself haha)

No big deal - and it is used for copying selected text as well. So mhm, maybe not the best choice. But good that we managed to get rid of one choice at least.

@jesseduffield
Copy link
Owner

If nobody objects I say we go with '-'

@mark2185 mark2185 added docs requires-maintainer-signoff PR is reviewed but requires final signoff labels Dec 1, 2023
@jesseduffield jesseduffield merged commit f5361fd into jesseduffield:master Dec 1, 2023
1 check passed
@jesseduffield
Copy link
Owner

Thanks @smangels !

stefanhaller added a commit that referenced this pull request Dec 2, 2023
This was forgotten in #3046.
@stefanhaller stefanhaller mentioned this pull request Dec 2, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs requires-maintainer-signoff PR is reviewed but requires final signoff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Branches - switch branch to previous one
5 participants