X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=scripts%2Fkernel-send-patches.sh;fp=scripts%2Fkernel-send-patches.sh;h=daf770830bfb306cb76ac182e3d236739bf56003;hb=0705c2779d53e96c9a624b33ed48ef018b4e96f1;hp=e98cd3f840a4b8bca7a8b3db09cd87309ebdeabd;hpb=a5da940f226a74aba1c50279d04b37897beeec63;p=hvutilities.git diff --git a/scripts/kernel-send-patches.sh b/scripts/kernel-send-patches.sh index e98cd3f..daf7708 100755 --- a/scripts/kernel-send-patches.sh +++ b/scripts/kernel-send-patches.sh @@ -156,6 +156,11 @@ if [ x"${base_branch}" = x"" ]; then exit 1 fi +if [ x"${compile_branch}" = x"" ]; then + echo "Missing compile_branch shell variable" + exit 1 +fi + if [ x"${base_commit}" = x"" ]; then base_commit="auto" fi @@ -311,11 +316,29 @@ fi sed -i -e "s@COMPILE_CMD@${compile_cmd}@" ${compile_script} chmod u+x ${compile_script} -# Compile each commit. Create branch to avoid "detached HEAD" state, and also to -# keep a record of what was sent: -git rebase --exec=${compile_script} ${base_branch} +# Create temporary branch for compilation, based on compile_branch: +temp_compile_branch="${patches_branch}_compile" + +if git branch | grep -q ${temp_compile_branch}; then + git branch -D ${temp_compile_branch} +fi + +git checkout -b ${temp_compile_branch} ${compile_branch} + +# Make sure temp_compile_branch is rebased on base_branch: +git rebase ${base_branch} + +# Apply all of our commits to temp_compile_branch: +git cherry-pick ${COMMIT_START_SHA1}..${COMMIT_END_SHA1} + +# Compile and test each commit: +git rebase --exec=${compile_script} ${compile_branch} + git checkout ${orig_branch} +# Remove temporary branch: +git branch -D ${temp_compile_branch} + # Send email(s) git send-email ${DRY_RUN} --annotate --thread --no-chain-reply-to \ ${TO_OPTS} ${CC_OPTS} \