From patchwork Fri Oct 21 19:36:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9389987 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 0F70960780 for ; Fri, 21 Oct 2016 19:39:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFAB32A276 for ; Fri, 21 Oct 2016 19:39:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E43392A28E; Fri, 21 Oct 2016 19:39:05 +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=unavailable 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 B192D2A276 for ; Fri, 21 Oct 2016 19:39:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 871846EDF3; Fri, 21 Oct 2016 19:37:40 +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 070B36EDBD for ; Fri, 21 Oct 2016 19:37:22 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id d128so218609wmf.0 for ; Fri, 21 Oct 2016 12:37:21 -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=nanHgJ6K8DbqfnudshbKMXlUJvkKvYkGpiGRE7UIwt0=; b=VPhKJplLGI62Ch7kxQCiuUEAOALnUXUUky+s43GeNgtownICmAmmcaKvkevW+U8mRd XTlo/qBrihg3veYtVqdEpJsnJk7zXZpZjE4FF/v6mOBs6a5naHV+STtx89Jwh/+ubXeI G0cw88g0MkH3b6iRSD20QbsE+pJ1Z3Y+UaUnA= 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=nanHgJ6K8DbqfnudshbKMXlUJvkKvYkGpiGRE7UIwt0=; b=dTootKSWX9+oPReiyR1hOImzHoXYQnSPKytp+rNpbiU74f832PyMZfk63rf0fdzmGB tMLloLhu1dvhSZHHYlkjrQom87SKhestqnmEMzswWHUYV5TlV4XDofFP0O82IUYQeIdR LBSWi3YtIfS9ZqKy9eXMBkdr4pI8lrHaWrLo9iDVKYdtWWYehBvmp5hYziJ0BHitsBlL bsF7bF/evHsW6o/825Bz216ru1uxENJOqQlBzydPoxuHZUgwr2M4+jsCThqrWxHaThIA we3C3iXZ85JKzuqEhZTWnpQUVIwj212R3CJWCFNv3j4NR5WD90j1EusTLXxmx4jLvoXw b4CA== X-Gm-Message-State: AA6/9RmKXNoJhPwxLUXr2lm0WHkab+2/rB8aAFgqZma+2trOe1fWQTYtlAciafjPDCxl4g== X-Received: by 10.28.220.8 with SMTP id t8mr11246182wmg.88.1477078640077; Fri, 21 Oct 2016 12:37:20 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:56b5:0:ac27:b86c:7764:9429]) by smtp.gmail.com with ESMTPSA id q134sm5756630wme.3.2016.10.21.12.37.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Oct 2016 12:37:19 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Fri, 21 Oct 2016 21:36:47 +0200 Message-Id: <20161021193700.22100-6-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161021193700.22100-1-daniel.vetter@ffwll.ch> References: <20161021193700.22100-1-daniel.vetter@ffwll.ch> Cc: Daniel Vetter , Intel Graphics Development , Daniel Vetter Subject: [Intel-gfx] [PATCH 05/18] dim: support git worktree for aux checkouts 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 If available by default. This saves quite a pile of disk-space that imo making it the default is justified. Note that this will break the rebuild-nightly script for now, follow-up patches will fix that. Signed-off-by: Daniel Vetter --- dim | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/dim b/dim index 90eb553c6575..80baf24e4ad7 100755 --- a/dim +++ b/dim @@ -1072,15 +1072,24 @@ function setup_aux_checkout # name remote echo "Setting up $dir ..." if [ ! -d $dir ]; then - git clone --reference=$DIM_PREFIX/$DIM_DRM_INTEL/.git $remote_url $dir - cd $dir - git config remote.origin.url $remote_url - echo "$DIM_PREFIX/$DIM_DRM_INTEL/.git/objects" > .git/objects/info/alternates - git repack -a -d -l - remote=origin + if git help worktree &> /dev/null ; then + cd $DIM_PREFIX/$DIM_DRM_INTEL + remote=`get_remote_name $remote_url` + if ! git branch | grep $name > /dev/null ; then + git branch --track $name $remote/$name + fi + git worktree add ../$dir $name + else + git clone --reference=$DIM_PREFIX/$DIM_DRM_INTEL/.git $remote_url $dir + cd $dir + git config remote.origin.url $remote_url + echo "$DIM_PREFIX/$DIM_DRM_INTEL/.git/objects" > .git/objects/info/alternates + git repack -a -d -l + remote=origin + fi else cd $dir - remote=`get_remote_name $drm_intel_ssh` + remote=`get_remote_name $remote_url` fi if ! git branch | grep $name > /dev/null ; then git checkout -t $remote/$name