potiuk commented on PR #60194: URL: https://github.com/apache/airflow/pull/60194#issuecomment-3721003819
> Ah, a merge commit. Confusing since it has 2 parents. Apparently the "first" parent is the commit from the base branch, which is why this works. TIL. Correct. This is actually what we **very** heavily bank on (this why I knew it by heart). Basically whole selective checks code is based on the fact that we have "merge" commit passed as github.sha and it's first parent is base branch. https://github.com/apache/airflow/blob/main/dev/breeze/src/airflow_breeze/commands/ci_commands.py#L163: ```python def get_changed_files(commit_ref: str | None) -> tuple[str, ...]: if commit_ref is None: return () cmd = [ "git", "diff-tree", "--no-commit-id", "--name-only", "-r", commit_ref + "^", commit_ref, ] result = run_command(cmd, check=False, capture_output=True, text=True) if result.returncode != 0: get_console().print( f"[warning] Error when running diff-tree command [/]\n{result.stdout}\n{result.stderr}" ) return () changed_files = tuple(result.stdout.splitlines()) if result.stdout else () get_console().print("\n[info]Changed files:[/]\n") get_console().print(changed_files) get_console().print() return changed_files ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
