From 2fae2c378e3f6b8fd6559bd130098b005ea2c1e2 Mon Sep 17 00:00:00 2001 From: Antonin Hildebrand Date: Sat, 23 Jan 2016 15:51:25 +0100 Subject: [PATCH] introduce helper script diff-upstream.sh --- scripts/config.sh | 1 + scripts/diff-upstream.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100755 scripts/diff-upstream.sh diff --git a/scripts/config.sh b/scripts/config.sh index 723b54b255..b260507269 100755 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -30,5 +30,6 @@ CSS_PROPERTIES_COPY="$DEVTOOLS_ROOT/CSSProperties.in" CSS_PROPERTIES_OUTPUT_FILE="$DEVTOOLS_ROOT/front_end/SupportedCSSProperties.js" INSPECTOR_BACKEND_COMMANDS_OUTPUT_FILE="$DEVTOOLS_ROOT/front_end/InspectorBackendCommands.js" SCRIPTS="$ROOT/scripts" +DIFF_WORK_DIR="$ROOT/../diff-upstream" popd . \ No newline at end of file diff --git a/scripts/diff-upstream.sh b/scripts/diff-upstream.sh new file mode 100755 index 0000000000..04c76cf1a6 --- /dev/null +++ b/scripts/diff-upstream.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -e + +. "$(dirname "${BASH_SOURCE[0]}")/config.sh" + +pushd "$ROOT" + +MESSAGE=$(git log -1 HEAD --pretty=format:%s) + +if [[ ! "$MESSAGE" == *"merge updates from official devtools"* ]]; then + echo "run ./scripts/squash-and-merge-official-updates.sh before diffing" + echo "unmerged changes would appear in the diff" + exit 1 +fi + +if [ -d "$DIFF_WORK_DIR" ] ; then + rm -rf "$DIFF_WORK_DIR" +fi + +git clone "$ROOT" "$DIFF_WORK_DIR" --branch "$DEVTOOLS_BRANCH" + +pushd "$DIFF_WORK_DIR" + +cp -r "$DEVTOOLS_ROOT"/* . + +gitup + +popd \ No newline at end of file