jimporter / mike

Manage multiple versions of your MkDocs-powered documentation via Git
BSD 3-Clause "New" or "Revised" License
528 stars 47 forks source link

Add option to "deploy" command in order to add a prefix string to commit message #107

Closed VerrNum closed 2 years ago

VerrNum commented 2 years ago

In order to match the conventional commits , could you provide a way to add prefix string to commit message ?

Regards,

jimporter commented 2 years ago

There's a --message option to do this, though you'd have to fill in the commit SHA and such yourself if you wanted to include that. Maybe it would make sense to fill in template values for user-specified messages so that you could do something like --message "Committed {rev}...".

jimporter commented 2 years ago

I think with the --message option and the fact that you can do subshell expansions to grab info about the deploy process, this is already supported. For example, you could explicitly set the same message that mike does automatically like:

mike deploy $VERSION --message \
"Deployed `git rev-parse HEAD` to $VERSION with `mkdocs --version | sed -e 's/, version//' -e 's/ from.*//'` and `mike --version`"

(Most of the difficulty is fixing up the mkdocs --version formatting, and even that isn't too messy in the grand scheme of things.)