Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/scripts/create-backport-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@ git checkout -B "${branch}" "origin/${TARGET_BRANCH}"
# everything turns the unmerged entries into a normal (dirty) commit.
had_conflict=false
conflict_files=""
if ! git cherry-pick --no-commit "${MERGE_SHA}"; then
# Rename-detection knobs kept identical to prepare-backport-checkout.sh so a
# green preflight and this branch don't disagree over a package/directory
# rename. See that script for the rationale behind each setting.
if ! git -c merge.renameLimit=999999 \
-c diff.renameLimit=999999 \
-c merge.directoryRenames=true \
cherry-pick -Xrename-threshold=40% --no-commit "${MERGE_SHA}"; then
had_conflict=true
conflict_files="$(git diff --name-only --diff-filter=U | tr '\n' ' ')"
log "cherry-pick conflicted in: ${conflict_files}"
Expand Down
13 changes: 12 additions & 1 deletion .github/scripts/prepare-backport-checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,15 @@ end_tree="$(git rev-parse "${end_sha}^{tree}")"
squash_sha="$(git commit-tree -p "${start_sha}" -m "ci: squashed backport of ${commit_range}" "${end_tree}")"

git checkout -B "${workspace_branch}" "origin/${target_branch}"
git cherry-pick -x "${squash_sha}"
# Rename-detection knobs (kept identical in create-backport-branch.sh so the
# preflight and the branch it later builds agree): a package/directory rename
# between main and the release branch would otherwise produce spurious
# conflicts. Raise the rename limits so Git does not silently skip inexact
# rename detection when many paths moved; enable directory-rename detection so
# files this backport *adds* under an old package path follow the rename; and
# lower the similarity threshold since a rename that also rewrites package/
# import lines can drop a small file below the 50% default.
git -c merge.renameLimit=999999 \
-c diff.renameLimit=999999 \
-c merge.directoryRenames=true \
cherry-pick -Xrename-threshold=40% -x "${squash_sha}"
9 changes: 8 additions & 1 deletion .github/workflows/direct-backport-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,14 @@ jobs:
git checkout -B "${TARGET_BRANCH}" "origin/${TARGET_BRANCH}"
base_sha=$(git rev-parse HEAD)
log "base_sha=${base_sha}"
if ! git cherry-pick --no-commit "${MERGE_SHA}"; then
# Rename-detection knobs kept identical to prepare-backport-checkout.sh
# (the preflight) so a rename resolved cleanly there does not conflict
# here on the straight-to-release cherry-pick. See that script for the
# rationale behind each setting.
if ! git -c merge.renameLimit=999999 \
-c diff.renameLimit=999999 \
-c merge.directoryRenames=true \
cherry-pick -Xrename-threshold=40% --no-commit "${MERGE_SHA}"; then
endgroup
group "Conflict diagnosis"
conflicts=$(git diff --name-only --diff-filter=U)
Expand Down
Loading