dotfiles/fish/.config/fish/functions/glmd.fish

10 lines
366 B
Fish

function glmd --description 'Format commits in markdown for MR descriptions and copy to clipboard'
if not test -d .git
echo "Not a git repository"
return 0
end
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