From patchwork Tue Oct 18 19:38:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9382837 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0B71B600CA for ; Tue, 18 Oct 2016 19:39:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E478C29741 for ; Tue, 18 Oct 2016 19:39:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D74DC297A6; Tue, 18 Oct 2016 19:39:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0EFB729741 for ; Tue, 18 Oct 2016 19:39:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 587516E7B1; Tue, 18 Oct 2016 19:39:03 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 898846E7B3 for ; Tue, 18 Oct 2016 19:39:01 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id g16so892532wmg.2 for ; Tue, 18 Oct 2016 12:39:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=j0qF7TPiE8klAdOTkoHfiGAHGshKRAjmUJ7y5MY6Xv4=; b=cHGzg+pmGZeY+eoBwhvEayHltlzGsgGtCsKylG1ob8SO75/S4nr1R/I6/eqsO2CcLB KMVdMAA0HJqaB/a5S8w1n2+xVPP0BXF9fAV39iSzTYWGSLb0zOKnGvllcwM9g2dVkbDj 62CbnOuEnN260IBxYQpm6vnjWldelfVmQ+WEI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=j0qF7TPiE8klAdOTkoHfiGAHGshKRAjmUJ7y5MY6Xv4=; b=LmrUISQG56c3T0ta9mHh2gnIXTvXADqjDqUQLUNIO5gEl4oMiQ7VbmeCs5PYx+MHH6 h6KU26VihsghlpBZWc/Mt57MMES3VdlI0xoxXX2YrRK57SSrw6DbxXYWOA5vk30NPsjp 2Vhsy7qkn8xX8quNzC9L3twxjfdbHy1HBgm7RbZIBJJhQIDl31c5UID0eQ0ie9bVDU1M gkIKIzzJY9JRP93wy8WiBjwoeUsK+18giOMlOiWWUPjbvI/zE5Z2omdsrhLV3DCUpYw1 0ZQhE/fqks/ubbsANBoM/9qp/FG1VK9mIWL9704WtHVRGb4e5SJ52qXGXw/H7S1AOZie 8GVQ== X-Gm-Message-State: AA6/9Rm0J6pR1jf7sBHe89LODSK3/KKo6gbdl2rX+HJU2iChK9NHoE02CZxLao7iLl3ZNA== X-Received: by 10.28.52.148 with SMTP id b142mr1970716wma.5.1476819539761; Tue, 18 Oct 2016 12:38:59 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:56b5:0:ac27:b86c:7764:9429]) by smtp.gmail.com with ESMTPSA id r134sm1049684wme.8.2016.10.18.12.38.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Oct 2016 12:38:58 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Tue, 18 Oct 2016 21:38:52 +0200 Message-Id: <20161018193852.17213-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161018121356.9594-4-daniel.vetter@ffwll.ch> References: <20161018121356.9594-4-daniel.vetter@ffwll.ch> Cc: Daniel Vetter , DRI Development , Daniel Vetter Subject: [Intel-gfx] [PATCH] dim: autodetect branches in rebuild-nightly X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Needs new url-mapping information in nightly.conf to work properly. v2: - Fix typo when calling rr_cache_dir. Oops. - Use cut -f 1 instead of sed/regex horrors (jani). Signed-off-by: Daniel Vetter --- dim | 50 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/dim b/dim index 48d5e7b6477a..09879b166cee 100755 --- a/dim +++ b/dim @@ -197,7 +197,7 @@ function get_remote_name local remote_url=$1 local remote=`git remote -v | grep $remote_url | \ - head -n1 | sed -e 's/^\(.*\)\t.*/\1/'` + head -n1 | cut -f 1` if [[ $remote == "" ]] ; then echoerr No git remote for $remote_url found in `pwd`. @@ -235,20 +235,30 @@ function dim_commit_add_tag done } +function map_nightly_remote +{ + local nightly_remote=$1 + local remote_url=`eval echo "\\\$nightly_remote_url_${nightly_remote/-/_}"` + + get_remote_name $remote_url +} + function update_linux_next { cd $DIM_PREFIX/drm-intel-nightly + local nightly_origin=`map_nightly_remote origin` + # always update drm-intel-fixes echo -n "Pushing drm-intel-fixes to for-linux-next-fixes... " - git push $DRY_RUN origin +origin/drm-intel-fixes:for-linux-next-fixes >& /dev/null + git push $DRY_RUN $nightly_origin +$nightly_origin/drm-intel-fixes:for-linux-next-fixes >& /dev/null echo "Done." - if git merge-base --is-ancestor origin/drm-intel-next-fixes origin/drm-intel-fixes ; then + if git merge-base --is-ancestor $nightly_origin/drm-intel-next-fixes $nightly_origin/drm-intel-fixes ; then # -fixes has caught up to dinf, i.e. we're out of the merge # window. Push the next queue. echo -n "Out of merge window. Pushing drm-intel-next-queued to for-linux-next... " - git push $DRY_RUN origin +origin/drm-intel-next-queued:for-linux-next >& /dev/null + git push $DRY_RUN $nightly_origin +$nightly_origin/drm-intel-next-queued:for-linux-next >& /dev/null echo "Done." else # dinf is ahead of -fixes, i.e. drm-next has already closed for @@ -256,7 +266,7 @@ function update_linux_next # for the current -next cycle. Push dinf echo -n "Pushing drm-intel-next-fixes to for-linux-next... " - git push $DRY_RUN origin +origin/drm-intel-next-fixes:for-linux-next >& /dev/null + git push $DRY_RUN $nightly_origin +$nightly_origin/drm-intel-next-fixes:for-linux-next >& /dev/null echo "Done." fi } @@ -272,11 +282,20 @@ function check_conflicts true } +function rr_cache_dir +{ + if [ -d $DIM_PREFIX/drm-intel-nightly/.git/rr-cache/ ] ; then + echo $DIM_PREFIX/drm-intel-nightly/.git/rr-cache/ + else + echo $DIM_PREFIX/$DIM_DRM_INTEL/.git/rr-cache/ + fi +} + function update_rerere_cache { cd $DIM_PREFIX/drm-intel-rerere/ git pull - cp rr-cache/* $DIM_PREFIX/drm-intel-nightly/.git/rr-cache/ -r + cp rr-cache/* `rr_cache_dir` -r cd - } @@ -307,9 +326,10 @@ function dim_rebuild_nightly fi for remote in $(echo $nightly_branches | tr " " "\n" | sed 's|/.*$||g' | sort -u); do - echo -n "Fetching $remote... " + local nightly_remote=`map_nightly_remote $remote` + echo -n "Fetching $remote (as $nightly_remote) ... " # git fetch returns 128 if there's nothing to be fetched - git fetch $remote >& /dev/null || true + git fetch $nightly_remote >& /dev/null || true echo "Done." done @@ -329,12 +349,14 @@ function dim_rebuild_nightly if [[ -n $sha1 ]] ; then echo -n "Using override sha1: $sha1... " else - sha1=$branch + local remote=${branch%%/*} + local nightly_remote=`map_nightly_remote $remote` + sha1=`echo $branch | sed -e s/^$remote/$nightly_remote/` fi if [ $first == 1 ] ; then + git reset --hard $sha1 &> /dev/null echo "Reset. Done." - git reset --hard $sha1 >& /dev/null first=0 elif git merge --rerere-autoupdate --ff-only $sha1 >& /dev/null ; then # nothing to do if just fast-forward @@ -370,14 +392,16 @@ function dim_rebuild_nightly git commit --quiet -m "$integration_branch: $time integration manifest" echo "Done." + local nightly_origin=`map_nightly_remote origin` + echo -n "Pushing $integration_branch... " - git push $DRY_RUN origin +HEAD >& /dev/null && echo "Done." + git push $DRY_RUN $nightly_origin +HEAD >& /dev/null && echo "Done." echo -n "Updating rerere cache... " cd $rerere if git branch | grep rerere-cache | grep '\*' >& /dev/null ; then git pull >& /dev/null - cp $DIM_PREFIX/$integration_branch/.git/rr-cache/* rr-cache -r + cp `rr_cache_dir` rr-cache -r git add *.patch >& /dev/null || true git add rr-cache/* > /dev/null if git commit -m "$time: $integration_branch rerere cache update" >& /dev/null; then @@ -386,7 +410,7 @@ function dim_rebuild_nightly echo -n "Nothing changed. " fi echo -n "Pushing rerere cache... " - git push $DRY_RUN origin HEAD >& /dev/null && echo "Done." + git push $DRY_RUN $nightly_origin HEAD >& /dev/null && echo "Done." else echo "Fail: Branch setup for the rerere-cache is borked." exit 1