[llvm-dev] Delete Phabricator metadata tags before committing

Fangrui Song via llvm-dev llvm-dev at lists.llvm.org
Fri Dec 27 12:48:46 PST 2019


Many git commits in the monorepo look like the following:

   [Tag0][Tag1] Title line
   
   Summary:
   Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque mauris neque, porta nec tristique at, sagittis vel nisi. Fusce pharetra nunc et mauris consequat venenatis.
   
   Reviewers: username0, username1
   
   Reviewed By: username0
   
   Subscribers: username2, username3, llvm-commits

   Tags: #llvm
   
   Differential Revision: https://reviews.llvm.org/Dxxxxx

These Phabricator metadata lines (`Reviewers:`, `Reviewed By:`, etc) are created automatically when the author uploads the patch via `arc diff 'HEAD^'`.
The summary and metadata can be copied from Phabricator to the local commit via `arc amend`.

Among the metadata tags, `Differential Revision:` is the most useful one. It associates a commit with a Phabricator differential (Dxxxxx) and allows the differential to be closed automatically when the commit is pushed to llvm-project master.

The other tags (Subscribers:, Reviewers:, Reviewed By:, Tags:, and the `Summary:` line) are not useful. They just clutter up the commit message. Shall we mention on https://llvm.org/docs/DeveloperPolicy.html that developers are recommended to delete metadata tags before committing? It'd be nice if some pre-receive hooks can be set up to enforce deleting some really unnecessary metadata tags.


More information about the llvm-dev mailing list