Skip to content

Commit

Permalink
Update ignore_template_commit to ignore checkout changes
Browse files Browse the repository at this point in the history
We don't want to see diffs when running `sync` with a custom template
version, since this flag is primarily intended to be run on template
repo PRs where we don't care that the template version changes since the
actual change will only be applied once we merge the PR.
  • Loading branch information
simu committed Dec 30, 2024
1 parent ac46b18 commit 26563d4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions commodore/dependency_templater.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,20 @@ def _ignore_cruft_json_commit_id(
n=0,
)
)[3:]
# If the context-less diff has exactly 2 lines and both of them start with
# '[-+] "commit":', we omit the diff
if (
# If the context-less diff has exactly 2 lines and both of them start with
# '[-+] "commit":', we omit the diff
len(minimal_diff) == 2
and minimal_diff[0].startswith('- "commit":')
and minimal_diff[1].startswith('+ "commit":')
) or (
# If the context-less diff has exactly 4 lines and the two pairs start with
# '[-+] "commit":' and '[-+] "checkout":', we omit the diff
len(minimal_diff) == 4
and minimal_diff[0].startswith('- "commit":')
and minimal_diff[1].startswith('- "checkout":')
and minimal_diff[2].startswith('+ "commit":')
and minimal_diff[3].startswith('+ "checkout":')
):
omit = True
# never suppress diffs in default difffunc
Expand Down

0 comments on commit 26563d4

Please sign in to comment.