Git is a little lax on properly distinguishing between plumbing and porcelain. The advice to use plumbing commands in scripts is good, but sometimes a command—such as git log
—doesn't have an appropriate plumbing variant, but does have options that make it "plumby", if I can make up a word.
In this case, an appropriate command is (edited, 21 Mar 2019, per comment from Josh):
git -c log.showSignature=false log --pretty=format:%ad --no-walk <hash>
(or the same with %cd
as the format directive for committer date; add various date formatting options, to git log
itself, or as %aD
for instance, to change the date format). Nothing exactly promises that git log
might not add new features, such as the log.decorate
setting, that might disrupt this, and Git should get with itself and add --porcelain
options to the commands that behave like git status
does. (Note that git status
now has --porcelain
and --porcelain=v2
, both of which convert it to plumbing. Don't ask me why this isn't spelled --plumbing
...)