summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYvan Roux <yvan.roux@linaro.org>2015-03-18 21:21:25 +0100
committerYvan Roux <yvan.roux@linaro.org>2015-03-18 21:21:25 +0100
commita4c4f5de540fe3396ff1c76155cb5e5e273cf698 (patch)
tree97e17ffedc7cac773e363ef2dcb07c680d1580c9
parentca4cddd35b5b9d937d3f83845b9431d0f910c022 (diff)
downloadbackflip-a4c4f5de540fe3396ff1c76155cb5e5e273cf698.tar.gz
Add a Verification step before branch creation to compare original
commit with the ongoing backport.
-rwxr-xr-xbackflip32
1 files changed, 30 insertions, 2 deletions
diff --git a/backflip b/backflip
index ef6b939..265885d 100755
--- a/backflip
+++ b/backflip
@@ -18,6 +18,7 @@ FNAME=`echo ${NAME} | cut -d ' ' -f 1`
EMAIL=`git config user.email`
EDITOR="${EDITOR:-vim}"
STACKED=false
+CMPTOOL="meld"
# Arguments
while getopts "b:r:v:" options
@@ -34,6 +35,7 @@ do
done
shift $(($OPTIND - 1))
+REV=$1
if [ -z ${DEV_BRANCH+x} ]; then
DEV_BRANCH=${REF_BRANCH}
fi
@@ -62,6 +64,10 @@ die() {
exit 1
}
+open_shell() {
+ PROMPT_COMMAND="echo -n -e '${bold}[${red}BackFLiP${NC}${bold}]${NC} '" bash
+}
+
# arg1 : a sentence
# arg2 : a variable
# print arg1 and gather user input in arg2
@@ -88,6 +94,19 @@ forge_entry() {
git add $2.$1.frag
}
+# arg1 : backported revision sha1
+compare() {
+ git show $1 > $REV.orig
+ git diff --cached > $REV.linaro
+ print_info "Generated diff files: ${bold}$REV.orig $REV.linaro${NC}"
+ "$CMPTOOL" $REV.orig $REV.linaro
+ ask "${bold}Do you need a Shell [N/y] ?" user_shell
+ if [ "$user_shell" == "y" ]; then
+ open_shell
+ fi
+ rm $REV.orig $REV.linaro
+}
+
# ==============================================================================
print_step "Checking Configuration"
# ==============================================================================
@@ -103,12 +122,16 @@ port=29418
project=toolchain/gcc
EOF
fi
+if ! which $CMPTOOL > /dev/null ; then
+ print_info "Default comparison tool is missing"
+ ask "Enter tool name: " CMPTOOL
+fi
print_info "${bold}OK${NC}"
# ==============================================================================
print_step "Finding SHA1"
# ==============================================================================
-SHA1=`git log --format=format:"%H" --grep=trunk@${1} master`
+SHA1=`git log --format=format:"%H" --grep=trunk@${REV} master`
print_info "${NC}SVN rev ${bold}${1}${NC} SHA1: ${bold}${SHA1}${NC}"
ask "${bold}View the commit [N/y] ?" user_view
if [ "$user_view" == "y" ]; then
@@ -140,10 +163,15 @@ print_step "Status Checking"
git status
ask "${bold}Open a Shell [N/y] ?" user_shell
if [ "$user_shell" == "y" ]; then
- PROMPT_COMMAND="echo -n -e '${bold}[${red}BackFLiP${NC}${bold}]${NC} '" bash
+ open_shell
fi
# ==============================================================================
+print_step "Verification"
+# ==============================================================================
+compare $SHA1
+
+# ==============================================================================
print_step "Branch/Commit/Push/Review"
# ==============================================================================
if $STACKED; then