[PATCH] D80978: Add a git hook script that can be manually setup to run some checks on every push

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 1 23:15:46 PDT 2020


MaskRay added inline comments.


================
Comment at: llvm/utils/git/arcfilter.sh:6
+  sed  's/^Summary://'  | \
+  awk '/Reviewers: /{p=1; sub(/Reviewers: .*Differential Revision: /, "")}; /Differential Revision: /{p=0;}; !p' | \
+  git commit --amend -F - ; }
----------------
This version handles both `Summay: ...` (on the same line) and `Summary:\nmulti lines`

```
git log -1 --pretty=%B | awk '/Reviewers:|Subscribers:/{p=1} /Reviewed By:|Differential Revision:/{p=0} !p && !/^Summary:$/ {sub(/^Summary: /,"");print}' | git commit --amend --date=now -F -
```

In addition, I added `--date=now` to reset author date to committer date.


================
Comment at: llvm/utils/git/pre-push.py:1
+#!/usr/bin/env python
+#
----------------
I think we can just use `python3` and drop Python 2.7 support.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80978/new/

https://reviews.llvm.org/D80978





More information about the llvm-commits mailing list