Skip to content

[9.2.x] Backport format scripts fixes#13267

Open
masaori335 wants to merge 2 commits into
apache:9.2.xfrom
masaori335:asf-9.2.x-format
Open

[9.2.x] Backport format scripts fixes#13267
masaori335 wants to merge 2 commits into
apache:9.2.xfrom
masaori335:asf-9.2.x-format

Conversation

@masaori335

Copy link
Copy Markdown
Contributor

Backport #11015 and #11495 to run format scripts in git worktree directories.

masaori335 and others added 2 commits June 15, 2026 12:43
The alternate way of getting this, that we are currently using,
doesn't work in cmake version 3.28.

(cherry picked from commit 2ef63fa)
@masaori335 masaori335 requested a review from ezelkow1 June 15, 2026 03:45
@masaori335 masaori335 self-assigned this Jun 15, 2026
@masaori335 masaori335 requested a review from bryancall as a code owner June 15, 2026 03:45
Copilot AI review requested due to automatic review settings June 15, 2026 03:45
@masaori335 masaori335 requested a review from zwoop as a code owner June 15, 2026 03:45
@masaori335 masaori335 added Backport Marked for backport for an LTS patch release format labels Jun 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Backports formatting-script fixes to support running formatter installation/execution when the source tree is a Git worktree, by switching formatter cache locations from $(repo)/.git/... to the resolved Git directory path.

Changes:

  • Update yapf.sh to place its virtualenv under git rev-parse --absolute-git-dir’s fmt/ directory.
  • Update autopep8.sh to place its virtualenv under git rev-parse --absolute-git-dir’s fmt/ directory.
  • Update clang-format.sh to install/download under git rev-parse --absolute-git-dir’s fmt/ directory.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
tools/yapf.sh Switches YAPF venv location to an absolute Git dir fmt/ path for worktree compatibility.
tools/clang-format.sh Switches clang-format install root to an absolute Git dir fmt/ path for worktree compatibility.
tools/autopep8.sh Switches autopep8 venv location to an absolute Git dir fmt/ path for worktree compatibility.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/clang-format.sh
Comment on lines +27 to +28
GIT_DIR=$(git rev-parse --absolute-git-dir)
ROOT=${ROOT:-${GIT_DIR}/fmt/${PKGDATE}}
Comment thread tools/clang-format.sh
Comment on lines +123 to +124
GIT_DIR=$(git rev-parse --absolute-git-dir)
ROOT=${ROOT:-${GIT_DIR}/fmt/${PKGDATE}}
Comment thread tools/autopep8.sh
Comment on lines +43 to +44
GIT_DIR=$(git rev-parse --absolute-git-dir)
AUTOPEP8_VENV=${AUTOPEP8_VENV:-${GIT_DIR}/fmt/autopep8_${AUTOPEP8_VERSION}_venv}
Comment thread tools/autopep8.sh
Comment on lines +119 to +120
GIT_DIR=$(git rev-parse --absolute-git-dir)
AUTOPEP8_VENV=${AUTOPEP8_VENV:-${GIT_DIR}/fmt/autopep8_${AUTOPEP8_VERSION}_venv}
Comment thread tools/yapf.sh
Comment on lines 49 to +51
REPO_ROOT=$(cd $(dirname $0) && git rev-parse --show-toplevel)
YAPF_VENV=${YAPF_VENV:-${REPO_ROOT}/.git/fmt/yapf_${YAPF_VERSION}_venv}
GIT_DIR=$(git rev-parse --absolute-git-dir)
YAPF_VENV=${YAPF_VENV:-${GIT_DIR}/fmt/yapf_${YAPF_VERSION}_venv}
Comment thread tools/yapf.sh
Comment on lines +109 to +110
GIT_DIR=$(git rev-parse --absolute-git-dir)
YAPF_VENV=${YAPF_VENV:-${GIT_DIR}/fmt/yapf_${YAPF_VERSION}_venv}
@zwoop

zwoop commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Feels like we should ignore Copilots concerns here, assuming this is also on master. But maybe address them later on master ?

@zwoop zwoop left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with the caveat that this is the same version running on master.

@ezelkow1

Copy link
Copy Markdown
Member

[approve ci fedora autest]

@cmcfarlen cmcfarlen added this to the 9.2.14 milestone Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport Marked for backport for an LTS patch release format

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants