cherry_pick.sh: improve cherry_pick.sh [1/1]
PD#SWPL-67525
Problem:
improve cherry_pick.sh to show git status when applying patch failed
Solution:
improve cherry_pick.sh to show git status when applying patch failed
Verify:
ad401_a113l
Signed-off-by: Kelvin Zhang <kelvin.zhang@amlogic.com>
Change-Id: Ia7fc43d0686f26450d57b08991b8b88f9458d341
diff --git a/cherry_pick.sh b/cherry_pick.sh
index 18f9bb1..e7f4b7c 100755
--- a/cherry_pick.sh
+++ b/cherry_pick.sh
@@ -34,7 +34,9 @@
cmd=`echo $line | sed -e 's/ssh:\/\/.*@scgit.amlogic.com/ssh:\/\/scgit.amlogic.com/'`
eval $cmd
if [ "$?" -ne 0 ]; then
- echo -e "-------- Applying patch failed! --------\n"
+ git status
+ git log -1
+ echo -e "-------- Failed to apply patch! --------"
exit 1
fi
popd > /dev/null
@@ -113,6 +115,8 @@
git fetch ssh://${GERRIT_SERVER}:${GERRIT_PORT}/${GERRIT_PROJECT} ${GERRIT_CHANGE_REF}
git cherry-pick FETCH_HEAD
if [ "$?" -ne 0 ]; then
+ git status
+ git log -1
echo -e "-------- Failed to apply patch! --------"
exit 1
fi