Allow copying multiple commit hashes with <c-o>
Is your feature request related to a problem? Please describe.
When I multi-select commits in the commits panel and press Ctrl+O (copy commit hash), lazygit shows:
Disabled: Action does not support range selection, please select a single item.It would be useful if copying commit hashes supported multiple selected commits. Copying multiple hashes seems like an action that naturally works with range selection.
Describe the solution you'd like
Allow Ctrl+O to copy the hashes of all selected commits when multiple commits are selected.
For example, if three commits are selected, their hashes could be copied one per line:
abc123...
def456...
789abc...Optionally, the same could apply to branch names when using Ctrl+O in the branches panel.
Describe alternatives you've considered
One workaround is to use a custom git log command such as allBranchesLogCmds, for example:
git log --graph --color=always --abbrev-commit --decorate --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset"Then I can press 1 to open the log output and manually select/copy the hashes with the mouse.
For example:
* 21eeb24 - feat(vim): add opencode terminal keymap (5 months ago) <Risyanggi Azmi Faizin>
* a8abe42 - feat(vim): change copy path to fp, and support range (7 months ago) <Risyanggi Azmi Faizin>
* 538ff05 - feat(zsh): add alias oc=opencode (8 months ago) <Risyanggi Azmi Faizin>
* 32fa5d9 - chore(vim): update without crashing (8 months ago) <Risyanggi Azmi Faizin>
* 309e170 - feat(vim): remove cp mapping for markdown preview (8 months ago) <Risyanggi Azmi Faizin>This works, but it requires leaving the normal commit selection flow and manually selecting the hashes from the log output. It would be more convenient if Ctrl+O could simply copy the hashes from the commits currently selected in the commits panel.
Additional context
This is mainly about copying commit hashes from multiple selected commits. I haven't run into a strong need for the other y options to support range selection. Copying multiple branches is a bonus.
Happy to provide more details if needed.
Source: jesseduffield/lazygit