Created
April 24, 2026 14:33
-
-
Save pascalchevrel/d90f37895d12fc7809130924a97ded81 to your computer and use it in GitHub Desktop.
pick_no_amend for ESR relbranch
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
| pick_no_amend() { | |
| if [ -z "$1" ]; then | |
| echo "Usage: pick <commit-sha>" | |
| return 1 | |
| fi | |
| commit="$1" | |
| # Get the upstream tracking branch | |
| upstream=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null) | |
| if [ -z "$upstream" ]; then | |
| echo "π« Could not determine upstream branch. Are you on a tracking branch?" | |
| return 1 | |
| fi | |
| echo "π Trying to cherry-pick $commit..." | |
| # Standard cherry-pick: this creates a new commit automatically | |
| if git cherry-pick "$commit"; then | |
| echo "β Cherry-pick applied cleanly to the current branch." | |
| echo "Staged for $upstream. You can now manually amend if needed." | |
| git log -n 1 --oneline | |
| else | |
| echo "β Cherry-pick failed β aborting." | |
| git cherry-pick --abort | |
| return 1 | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment