Open moha-gh opened 3 weeks ago
What about a custom command as an alternative that would run something like this?
$> git log --format=%B -n 1 <commit> | xclip -sel clipboard
Thanks, I'll give that a try! I guess that would work, but two (possible) limitations come to mind:
os.copyToClipboardCmd
is not taken into account automatically if sety
, b
for example, wouldn't it? And from the list of contexts I guess it would need to be a global
one since the corresponding menu is not listed?os.copyToClipboardCmd is not taken into account automatically if set
Correct.
It would be tricky to get assign a keybinding that mimics the other 'copy attribute' commands, i.e. y, b for example, wouldn't it?
Not just tricky, but impossible. But hey, it's a workaround, not a solution that you had envisioned 😅
Is your feature request related to a problem? Please describe.
I frequently need to copy the commit message body to the clipboard. Currently this isn't possible, so I copy the whole message (via
y
,m
) and strip the subject manually.Describe the solution you'd like
An extra "Commit body" entry in the "Copy to clipboard" menu that copies the body of the commit message (i.e. the body with the subject and the empty separator line after that removed) to the clipboard.
Describe alternatives you've considered
n/a
Additional context
I'd be happy to (try to) file a PR for this, if the feature is deemed useful.