summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiao Pan <xyz@flylightning.xyz>2024-08-18 14:41:24 -0700
committerXiao Pan <xyz@flylightning.xyz>2024-08-18 14:41:24 -0700
commit8a7063b0f2d901745df7458731d19a0435d9657f (patch)
tree376e42379ce66b7c55cce6cb98e2287f9ace0a30
parentb5f90bc8f7c9e12fdab676e243437dac754488bc (diff)
consider git checkout and cherry-pick error
-rwxr-xr-xsh/ccp14
1 files changed, 12 insertions, 2 deletions
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