Skip to content

Commit f6601de

Browse files
committed
filesystem: specify commit message in hooks config
1 parent a75f606 commit f6601de

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

hooks/filesystem.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ class GitFilesystemHook(Hook):
254254
def __init__(self, parameters):
255255
super().__init__(parameters)
256256
self.repo_path = Path(self.configuration['repo'])
257+
self.commit_message = self.configuration.get('commit_message', None)
257258
self.file_content = self.configuration.get('file_content', False)
258259
self.repo = Repo(str(self.repo_path))
259260
# repo must be clean
@@ -301,6 +302,9 @@ def process_new_file(self, event):
301302

302303
def fs_capture_end(self, event):
303304
# commit
304-
domain_name = self.configuration['domain_name']
305-
self.logger.info('Creating new commit \'%s\'', domain_name)
306-
self.repo.git.commit('-m', domain_name)
305+
message = self.configuration['domain_name']
306+
# if exists and not empty
307+
if self.commit_message is not None and self.commit_message:
308+
message = self.commit_message
309+
self.logger.info('Creating new commit \'%s\'', message)
310+
self.repo.git.commit('-m', message)

0 commit comments

Comments
 (0)