[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
Tue Jun 2 21:21:08 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 - ; }
----------------
mehdi_amini wrote:
> mehdi_amini wrote:
> > MaskRay wrote:
> > > 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.
> > I'll update the `awk`, why should we add `--date=now` ?
> Done, but still ping @MaskRay in case you missed my question? (I'm curious)
Author dates (git log default) seem to be random. They are oftentimes misleading. (For example, it is difficult to tell whether a commit was really made yesterday) I changed my git log config to display committer dates by default, but many don't. Resetting my commits will make others easier when reading my commits.



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