to be fair with that specific example, they changed from a purpose-built function, to a shell call including (albeit extremely simple) text parsing.
I'd generally prefer not to have the git(1) incantation hanging around in an unrelated function.
I'd generally prefer not to have the git(1) incantation hanging around in an unrelated function.
Here's the original code from the "git-rev" package: https://github.com/tblobaum/git-rev/blob/master/index.js