Hey.

Apparently git-hooks skip all verification hooks for Revert commits:
https://github.com/AdaCore/git-hooks#revert-commits

I guess it's undesirable for us as we want to generate ChangeLog entries.
Thus I recommend to disable the bail out (attached patch).

And I'm sending a patch to gcc-changelog that skips the problematic revision
2635f9e5086318f4560997d9741fdda496b9c801 so that 
gcc-changelog/git_update_version.py
succeeds.

Thoughts?
Martin
>From d75559271a84b49d996cb5f70e805d7e20c4ab7b Mon Sep 17 00:00:00 2001
From: Martin Liska <mli...@suse.cz>
Date: Tue, 30 Jun 2020 09:26:10 +0200
Subject: [PATCH] gcc-changelog: skip problematic revision in
 git_update_version.

contrib/ChangeLog:

	* gcc-changelog/git_update_version.py: Skip a Revert commit
	we allowed on master.
---
 contrib/gcc-changelog/git_update_version.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/contrib/gcc-changelog/git_update_version.py b/contrib/gcc-changelog/git_update_version.py
index ac1b206d238..ee92607d738 100755
--- a/contrib/gcc-changelog/git_update_version.py
+++ b/contrib/gcc-changelog/git_update_version.py
@@ -34,6 +34,9 @@ def read_timestamp(path):
 
 def prepend_to_changelog_files(repo, folder, git_commit, add_to_git):
     if not git_commit.success:
+        # skip a Revert revision we accepted to master
+        if git_commit.hexsha == '2635f9e5086318f4560997d9741fdda496b9c801':
+            return
         for error in git_commit.errors:
             print(error)
         raise AssertionError()
-- 
2.27.0

>From 6c06403c4bb8570adc3f2bc9ec3b1c437ec281af Mon Sep 17 00:00:00 2001
From: Martin Liska <mli...@suse.cz>
Date: Tue, 30 Jun 2020 09:28:06 +0200
Subject: [PATCH] Run checks for Revert commits.

---
 hooks/updates/__init__.py | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/hooks/updates/__init__.py b/hooks/updates/__init__.py
index e47145f..14abbd1 100644
--- a/hooks/updates/__init__.py
+++ b/hooks/updates/__init__.py
@@ -231,17 +231,8 @@ class AbstractUpdate(object):
             # handled by the __no_cvs_check_user_override method.
             return
 
-        # Create a list of commits that were added, but with revert
-        # commits being filtered out. We have decided that revert commits
-        # should not be subject to any check (QB08-047).  This allows
-        # users to quickly revert a commit if need be, without having
-        # to worry about bumping into any check of any kind.
+        # Create a list of commits that were added.
         added = self.added_commits
-        for commit in added:
-            if is_revert_commit(commit.rev):
-                debug('revert commit detected,'
-                      ' all checks disabled for this commit: %s' % commit.rev)
-                added.remove(commit)
 
         if not added:
             # There are no new commits, so nothing further to check.
-- 
2.27.0

Reply via email to