diff --git a/docs/about/release-notes.md b/docs/about/release-notes.md index be7b2f49d8..b690b21573 100644 --- a/docs/about/release-notes.md +++ b/docs/about/release-notes.md @@ -23,6 +23,7 @@ The current and past members of the MkDocs team. ## Development Version +* Expand {sha} and {version} in gh-deploy commit message (#1410). * Compress `sitemap.xml` (#1130). * Defer loading JS scripts (#1380). * Add a title attribute to the search input (#1379). diff --git a/mkdocs/__main__.py b/mkdocs/__main__.py index 95c649f804..8c231180fe 100644 --- a/mkdocs/__main__.py +++ b/mkdocs/__main__.py @@ -82,8 +82,8 @@ def common_options(f): reload_help = "Enable the live reloading in the development server (this is the default)" no_reload_help = "Disable the live reloading in the development server." dirty_reload_help = "Enable the live reloading in the development server, but only re-build files that have changed" -commit_message_help = ("A commit message to use when commiting to the " - "Github Pages remote branch") +commit_message_help = ("A commit message to use when committing to the " + "Github Pages remote branch. Commit {sha} and MkDocs {version} are available as expansions") remote_branch_help = ("The remote branch to commit to for Github Pages. This " "overrides the value specified in config") remote_name_help = ("The remote name to commit to for Github Pages. This " diff --git a/mkdocs/commands/gh_deploy.py b/mkdocs/commands/gh_deploy.py index 13d359cff1..b7b54be713 100644 --- a/mkdocs/commands/gh_deploy.py +++ b/mkdocs/commands/gh_deploy.py @@ -56,8 +56,9 @@ def gh_deploy(config, message=None, force=False): 'repository') if message is None: - sha = _get_current_sha() - message = default_message.format(version=mkdocs.__version__, sha=sha) + message = default_message + sha = _get_current_sha() + message = message.format(version=mkdocs.__version__, sha=sha) remote_branch = config['remote_branch'] remote_name = config['remote_name']