Skip to content

Commit 463f9c5

Browse files
committed
New cherry pick process in ezk.git
1 parent f49d1c3 commit 463f9c5

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

EasyKey.git/ezk-git-atln.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,19 @@ cherryPick() {
3030
echo "Enter commit you want to pick:"
3131
read cname
3232
[ "${cname}" = "" ] && waitonexit && return
33-
git cherry-pick "$cname"
33+
git branch
34+
echo "Select target branch:"
35+
read cbranch
36+
[ "${cbranch}" = "" ] && waitonexit && return
37+
git checkout $cbranch
38+
git cherry-pick $cname
39+
echo -n "Cherry picked $cname. Add files to stage(y/n)?" && wait_for_keypress
40+
[ "${REPLY}" != "y" ] && waitonexit && return
41+
git add .
42+
git cherry-pick --continue
43+
echo -n "Push changes(y/n)?" && wait_for_keypress
44+
[ "${REPLY}" != "y" ] && waitonexit && return
45+
git push origin $cbranch
3446
}
3547

3648
atlnStatus() {

EasyKey.git/ezk-git-atuc.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ function resetToCommitHard () {
4949
}
5050

5151
atucStatus() {
52-
coloredLog " ALWAYS PREFER REVERT " "$clrPurple" "$clrWhite" && printf "\n\r"
5352
echo
5453
echo "NOTE: if your work with remote repos and already
55-
pushed commits that you want to undo -> PREFER REVERT !!"
54+
pushed commits that you want to undo -> PREFER REVERT OVER RESET !!"
5655

5756
}
5857

@@ -65,11 +64,11 @@ checkoutWay() {
6564

6665
menuInit "Undoing changes"
6766
submenuHead "Undoing changes"
68-
menuItem a "Just checkout contents of previous commit into working dir" checkoutWay
69-
menuItem a "Revert last commit - (keep commit history - create new commit)" revertLastCommit
70-
menuItem b "Revert commit - (keep commit history - create new commit)" revertToCommit
71-
menuItem c "(Soft) Reset commit - (delete some commits - keep current working dir)" resetToCommit
72-
menuItem d "(Hard) Reset commit - (delete some commits - overwrite working dir)" resetToCommitHard
73-
menuItem e "Undo local changes (only effects untracked files)" clean
67+
menuItem a "Checkout a previous commit into workdir - (keep commit history - create new commit)" checkoutWay
68+
menuItem b "Revert last commit - (keep commit history - create new commit)" revertLastCommit
69+
menuItem c "Revert commit - (keep commit history - create new commit)" revertToCommit
70+
menuItem d "(Soft) Reset commit - (delete some commits - keep current working dir)" resetToCommit
71+
menuItem e "(Hard) Reset commit - (delete some commits - overwrite working dir)" resetToCommitHard
72+
menuItem f "Undo local changes (only effects untracked files)" clean
7473
startMenu "atucStatus"
7574
noterminate

0 commit comments

Comments
 (0)