From 8a7063b0f2d901745df7458731d19a0435d9657f Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 18 Aug 2024 14:41:24 -0700 Subject: consider git checkout and cherry-pick error --- sh/ccp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'sh/ccp') diff --git a/sh/ccp b/sh/ccp index 4083fe8..8b7cfcd 100755 --- a/sh/ccp +++ b/sh/ccp @@ -32,14 +32,24 @@ for commit in $(git rev-list --reverse "$picked..HEAD"); do branch_pick="$all_branch_no_master" fi for branch in $branch_pick; do - git checkout "$branch" + # Mostly due to cherry-pick error. It seems if cherry-pick passed, + # checkout will work. It is easier to check checkout error here and do + # a while loop here to make sure cherry-pick works, instead of check + # cherry-pick error. + while ! git checkout "$branch"; do + echo 'checkout error, fix and enter to continue' + read a + done git cherry-pick "$commit" git status done done cp "$XDG_DATA_HOME/mydata/cfgl_cherry_picked" "$XDG_DATA_HOME/mydata/cfgl_cherry_picked.bak" -git checkout master +while ! git checkout master; do + echo 'checkout error, fix and enter to continue' + read a +done git rev-parse HEAD > "$XDG_DATA_HOME/mydata/cfgl_cherry_picked" for branch in $all_branch_no_master; do -- cgit v1.2.3-70-g09d2