Improving The Commit URL CLI Command

I previously wrote a Byte about the commit-url command that I created and use frequently to copy the GitHub commit URL of the current commit. The main body of that command was determining the remote URL which can now be simplified given the new remote-url command I wrote about yesterday.

The command is so simple now, it’s actually a one liner!

echo "$(remote-url)/commit/${1:-$(git rev-parse --short HEAD)}"