I need a safe consitent way to get the git description of latest commit in node.js
git commit -m "some message" -m "this is the description"
I am using require('child_process').execSync('git log -1').toString();
which outputs:
commit f8f42hash5556666b3c518e3hash294b62e88888
Author: Developer Name <email@email.com>
Date: Tue Jun 28 08:10:09 2022 +0200
some message
this is the description
And I know that it is possible to add some -format='????' but following this guide; https://devhints.io/git-log-format I can't seem to find a option that gives me the description...
Edit: I see comments about description and message being treated as oine thing, which surprises me, because gitlabs interface can in fact tell the difference, I have also seen them as separetae fields in som GUI git manager (maybe git kraken or a vscode plugin)..
Here's how it looks in gitlab (--skipSmokeTest is the description)

You can get the message like this:
git log -1 --format='%b'
It will return:
some message
this is the description
Then you can extract the second line of text using JavaScript.
Beware the correct option is --pretty according to the Git log doc !
For me, you should use this, it works for me: git log -1 --pretty="format:%s".