mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
check-style: Improve the proposed git-rebase command
Include the sha used for the dry-run instead of using 'origin/main'. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2733>
This commit is contained in:
parent
ce4e58d118
commit
3d083655f1
@ -120,7 +120,7 @@ def reformat_chunks(chunks, rewrite):
|
||||
return changed
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(description='Check code style.')
|
||||
parser = argparse.ArgumentParser(description='Check code style. Needs uncrustify installed.')
|
||||
parser.add_argument('--sha', metavar='SHA', type=str,
|
||||
help='SHA for the commit to compare HEAD with')
|
||||
parser.add_argument('--dry-run', '-d', type=bool,
|
||||
@ -146,7 +146,11 @@ if dry_run is not True and rewrite is True:
|
||||
subprocess.run(["git", "commit", "--all", "--amend", "-C", "HEAD"], stdout=subprocess.DEVNULL)
|
||||
os._exit(0)
|
||||
elif dry_run is True and changed is True:
|
||||
print ("\nIssue the following command in your local tree to apply the suggested changes (needs uncrustify installed):\n\n $ git rebase origin/main --exec \"./check-style.py -r\" \n")
|
||||
print(f"""
|
||||
Issue the following command in your local tree to apply the suggested changes:
|
||||
|
||||
$ git rebase {sha} --exec "./check-style.py -r"
|
||||
""")
|
||||
os._exit(-1)
|
||||
|
||||
os._exit(0)
|
||||
|
Loading…
Reference in New Issue
Block a user