diff options
author | Amir Ayupov <aaupov@fb.com> | 2023-07-18 19:43:08 -0700 |
---|---|---|
committer | Amir Ayupov <aaupov@fb.com> | 2023-07-18 19:43:31 -0700 |
commit | 3837e3e6cecb8edbe3fdb2c73fb6cea6a8dc1a28 (patch) | |
tree | 089d9998ee2a9f076879842af09152234b65abf5 /bolt/utils | |
parent | 28c3a74a5c6c7ed1ac97a010ca080eaacfd7f324 (diff) | |
download | llvm-3837e3e6cecb8edbe3fdb2c73fb6cea6a8dc1a28.zip llvm-3837e3e6cecb8edbe3fdb2c73fb6cea6a8dc1a28.tar.gz llvm-3837e3e6cecb8edbe3fdb2c73fb6cea6a8dc1a28.tar.bz2 |
[BOLT][Utils] Pass cmp-rev to nfc-check-setup
Pass the revision to checkout to (cmp-rev) as nfc-check-setup option.
Simpifies the comparison against arbitrary commit, not just the previous one.
Reviewed By: #bolt, rafauler
Differential Revision: https://reviews.llvm.org/D155657
Diffstat (limited to 'bolt/utils')
-rwxr-xr-x | bolt/utils/nfc-check-setup.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bolt/utils/nfc-check-setup.py b/bolt/utils/nfc-check-setup.py index b7b30a9..710b183 100755 --- a/bolt/utils/nfc-check-setup.py +++ b/bolt/utils/nfc-check-setup.py @@ -42,6 +42,11 @@ def main(): action="store_true", help="Checkout back to the starting revision", ) + parser.add_argument( + "--cmp-rev", + default="HEAD^", + help="Revision to checkout to compare vs HEAD", + ) args, wrapper_args = parser.parse_known_args() bolt_path = f"{args.build_dir}/bin/llvm-bolt" @@ -77,8 +82,8 @@ def main(): if stash: # save local changes before checkout subprocess.run(shlex.split("git stash push -u"), cwd=source_dir) - # check out the previous commit - subprocess.run(shlex.split("git checkout -f HEAD^"), cwd=source_dir) + # check out the previous/cmp commit + subprocess.run(shlex.split(f"git checkout -f {args.cmp_rev}"), cwd=source_dir) # get the parent commit hash for logging new_ref = get_git_ref_or_rev(source_dir) # build the previous commit |