🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@jacobtylerwalls
Copy link
Member

I confess to running git cherry-pick accidentally a few times instead of the backport script, resulting in missing branch prefixes.

This should be invisible for most contributors, as pre-commit install does not install prepare-commit-msg hooks by default, see the installation command at the top of the script.

@github-actions github-actions bot added the no ticket Based on PR title, no linked Trac ticket label Dec 8, 2025
Comment on lines +22 to +23
# Cherry-pick the commit, but skip hooks
git -c core.hooksPath=/dev/null cherry-pick ${REV}
Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +3 to +4
# Install this prepare-commit-msg hook with
# pre-commit install --hook-type prepare-commit-msg
Copy link
Member Author

Choose a reason for hiding this comment

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

Here's the install step.

# Cherry-pick the commit
git cherry-pick ${REV}
# Cherry-pick the commit, but skip hooks
git -c core.hooksPath=/dev/null cherry-pick ${REV}
Copy link
Member Author

Choose a reason for hiding this comment

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

It occurs to me this isn't windows-friendly, but we can cross that bridge later. Perhaps we would want to just replace the backport script entirely with a fleshed out prepare-commit-msg hook.

I confess to running `git cherry-pick` accidentally a few times instead
of the backport script, resulting in missing branch prefixes.

# Cherry-pick the commit
git cherry-pick ${REV}
# Cherry-pick the commit, but skip hooks
Copy link
Member Author

Choose a reason for hiding this comment

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

This shows what we want -- I normally want the hook to catch naive uses of git cherry-pick, so I have to skip the hook here (where a naive cherry-pick is done intentionally).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no ticket Based on PR title, no linked Trac ticket

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant