diff --git a/doc/configuration.rst b/doc/configuration.rst index ef0f5e0..15dfade 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -1517,6 +1517,16 @@ and kept secure. Defaults to: ``/var/lib/pagure/sshkeys/`` +LOG_ALL_COMMITS +~~~~~~~~~~~~~~~ + +This configuration key will make pagure log all commits pushed to all +branches of all repositories instead of logging only the once that are +pushed to the default branch. + +Defaults to: ``False`` + + RepoSpanner Options ------------------- diff --git a/pagure/hooks/default.py b/pagure/hooks/default.py index 342b8d4..c16aa5f 100644 --- a/pagure/hooks/default.py +++ b/pagure/hooks/default.py @@ -272,7 +272,8 @@ class DefaultRunner(BaseRunner): oldrev, newrev, repodir, refname ) - if refname == default_branch: + log_all = _config.get("LOG_ALL_COMMITS", False) + if log_all or refname == default_branch: print( "Sending to redis to log activity and send commit " "notification emails" diff --git a/pagure/lib/tasks_services.py b/pagure/lib/tasks_services.py index 03a762d..08fa70d 100644 --- a/pagure/lib/tasks_services.py +++ b/pagure/lib/tasks_services.py @@ -202,7 +202,8 @@ def log_commit_send_notifications( _log.info("Processing %s commits in %s", len(commits), abspath) # Only log commits when the branch is the default branch - if branch == default_branch: + log_all = pagure_config.get("LOG_ALL_COMMITS", False) + if log_all or branch == default_branch: pagure.lib.git.log_commits_to_db(session, project, commits, abspath) # Notify subscribed users that there are new commits