This is an archive of the discontinued LLVM Phabricator instance.

utils: add a revert checker
ClosedPublic

Authored by george.burgess.iv on Jul 7 2021, 11:44 AM.

Details

Summary

Chrome OS and Android have found it useful to have an automated revert
checker. It was requested to upstream it, since other folks in the LLVM
community may also find value in it.

The tests depend on having a full (non-shallow) checkout of LLVM. This
seems reasonable to me, since:

  • the tests should only be run if the user is developing on this script
  • it's kind of hard to develop on this script without local git history :)

If people really want, the tests' dependency on LLVM's history can be
removed. It's mostly just effort/complexity that doesn't seem necessary.

Please see llvm/utils/revert_checker.py's docstring for more info/usage
examples.

Diff Detail

Event Timeline

george.burgess.iv requested review of this revision.Jul 7 2021, 11:44 AM
george.burgess.iv created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJul 7 2021, 11:44 AM
george.burgess.iv edited the summary of this revision. (Show Details)Jul 7 2021, 11:44 AM
tstellar accepted this revision.Jul 7 2021, 12:02 PM

Thank you! This looks great. I think we could use this in a GitHub action to help flag commits on the release branch that has been reverted in trunk. It may also be possible to setup a notification system that downstream users could subscribe to in order to be notified of reverts.

This revision is now accepted and ready to land.Jul 7 2021, 12:02 PM

Thanks for the quick review! :)

This revision was automatically updated to reflect the committed changes.
probinson added inline comments.
llvm/utils/revert_checker.py
183

Should this be assert across_sha instead of assert across_ref ? The ref could be spelled many ways, the sha is the canonical form and looks like what intermediate_commits should contain.

george.burgess.iv marked an inline comment as done.Jul 15 2021, 1:08 PM
george.burgess.iv added inline comments.
llvm/utils/revert_checker.py
183

yeah, definite typo on my end. thanks for catching this! fixed in 3a7ca4cad4dd42120ea39b919f45a166e85d54a8