[9.2.x] Backport format scripts fixes#13267
Open
masaori335 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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.shto place its virtualenv undergit rev-parse --absolute-git-dir’sfmt/directory. - Update
autopep8.shto place its virtualenv undergit rev-parse --absolute-git-dir’sfmt/directory. - Update
clang-format.shto install/download undergit rev-parse --absolute-git-dir’sfmt/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 on lines
+27
to
+28
| GIT_DIR=$(git rev-parse --absolute-git-dir) | ||
| ROOT=${ROOT:-${GIT_DIR}/fmt/${PKGDATE}} |
Comment on lines
+123
to
+124
| GIT_DIR=$(git rev-parse --absolute-git-dir) | ||
| ROOT=${ROOT:-${GIT_DIR}/fmt/${PKGDATE}} |
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 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 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 on lines
+109
to
+110
| GIT_DIR=$(git rev-parse --absolute-git-dir) | ||
| YAPF_VENV=${YAPF_VENV:-${GIT_DIR}/fmt/yapf_${YAPF_VERSION}_venv} |
Contributor
|
Feels like we should ignore Copilots concerns here, assuming this is also on master. But maybe address them later on master ? |
zwoop
approved these changes
Jun 15, 2026
zwoop
left a comment
Contributor
There was a problem hiding this comment.
Approved with the caveat that this is the same version running on master.
Member
|
[approve ci fedora autest] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport #11015 and #11495 to run format scripts in git worktree directories.