Bobby R. Bruce has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/25343 )
Change subject: misc: Updated git-commit-msg.py to print rejected commit
......................................................................
misc: Updated git-commit-msg.py to print rejected commit
A rejected commit is now printed to stdout. This adds an additional
level of security if the ".git/COMMIT_EDITMSG" is deleted/overwritten.
Jira: https://gem5.atlassian.net/browse/GEM5-321
Change-Id: I87d463f7c40024d68bf78705f0d02fcea9f0eeeb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25343
Reviewed-by: Bobby R. Bruce <[email protected]>
Maintainer: Bobby R. Bruce <[email protected]>
Tested-by: kokoro <[email protected]>
---
M util/git-commit-msg.py
1 file changed, 12 insertions(+), 4 deletions(-)
Approvals:
Bobby R. Bruce: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/util/git-commit-msg.py b/util/git-commit-msg.py
index 1ce8aa1..9d958e8 100755
--- a/util/git-commit-msg.py
+++ b/util/git-commit-msg.py
@@ -45,10 +45,19 @@
failure.
"""
print(error_message)
- print("""
-The commit has been canceled, but a copy of it can be found in
-.git/COMMIT_EDITMSG
+ print("The commit has been cancelled, but a copy of it can be found
in "
+ + sys.argv[1] + " : ")
+
+ print("""
+--------------------------------------------------------------------------
+ """)
+ print(open(sys.argv[1], "r").read())
+ print("""
+--------------------------------------------------------------------------
+ """)
+
+ print("""
The first line of a commit must contain one or more gem5 tags separated by
commas (see MAINTAINERS for the possible tags), followed by a colon and a
commit title. There must be no leading nor trailing whitespaces.
@@ -67,7 +76,6 @@
The packet class...
""")
- print("A copy of your commit message can be found in " + sys.argv[1])
sys.exit(1)
def _validateTags(commit_header):
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/25343
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I87d463f7c40024d68bf78705f0d02fcea9f0eeeb
Gerrit-Change-Number: 25343
Gerrit-PatchSet: 2
Gerrit-Owner: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev