fish: functions/glmd: Add an alias for formatting logs in markdown
Adapted from Heftig's (Jan Alexander Steffens) note on IRC git config --global alias.mdlog 'log --reverse --pretty=format:"- **%s** %w(0,2,2)%+b"' This will format commits in a way that's nice for pasting into MR descriptions, assuming the commit body is markdown. Usually used like below git mdlog @{u}.. | wl-copy git mdlog origin/main.. | wl-copy
This commit is contained in:
parent
91cbcbe75f
commit
210fc81fcd
1 changed files with 4 additions and 0 deletions
4
fish/.config/fish/functions/glmd.fish
Normal file
4
fish/.config/fish/functions/glmd.fish
Normal file
|
@ -0,0 +1,4 @@
|
|||
function glmd --description 'Format commits in markdown for MR descriptions and copy to clipboard'
|
||||
set -l remote (git symbolic-ref refs/remotes/origin/HEAD | awk -F'/' '{print $4}')
|
||||
git log --reverse --pretty=format:"- **%s** %w(0,2,2)%+b" origin/$remote.. | wl-copy
|
||||
end
|
Loading…
Reference in a new issue