From patchwork Tue Oct 18 12:13:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9382051 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 92EC460839 for ; Tue, 18 Oct 2016 12:14:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83FAC29599 for ; Tue, 18 Oct 2016 12:14:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 785D82959C; Tue, 18 Oct 2016 12:14:37 +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 47AAB29599 for ; Tue, 18 Oct 2016 12:14:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E6C896E6D1; Tue, 18 Oct 2016 12:14:34 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0F21D6E6DE for ; Tue, 18 Oct 2016 12:14:09 +0000 (UTC) Received: by mail-qk0-x241.google.com with SMTP id v138so16629800qka.2 for ; Tue, 18 Oct 2016 05:14:09 -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=fqAuSi1MwStBXhf7348yLETRqOny6QwX6X3QqLodNCRvpjr8lASp3lEY8YgiDYli0O zF0IegSS/7+USM8OBSUXtr9jDoSOEGrowcaV5X4509fn6h+wRSbSbgmLCsp/eSkq/KWC gqS/vZFHmNBlWMf1LOzDEGLIYk8lk5MU55SiQ= 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=BRiQAzMhk/UiqthOFC+vwVjhBfjYXGk1IkVYeoSU1XAd4SHqC9wX5Av7FGfgYq7oP5 rk0xhj0b41n0+RZG8rx9/ryLfIpziTTbFYNXWFzEsnDAu8jwizbMb3qnZuuvtJIMbZ4M ZtNx1JXXXpdSD9tU56mAaMMBAriiBqLUJ9wxFqga9j60utNDlEBaQ28gzvy6vjx6SE3e R0DRfhN7OrWbxeYIxUwOriL9e8YIK0eTV3LE6rGkhT4AoYNpFItXtEAjxvU884mAqSUa VfTZKvyGp2VzEu0R0iN8CFD16naPh+aYsc4X7hUmdK6Omhvx9o7w2T+t7qmwP/UGdpHe BzFg== X-Gm-Message-State: AA6/9RmPGEl01MXKN5c2taCW1wIeUWfGu0/v1/vlzVFcHL/n30z8WAYLz5SqaXYkhsx3HA== X-Received: by 10.194.113.35 with SMTP id iv3mr34701wjb.169.1476792847999; Tue, 18 Oct 2016 05:14:07 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:56b5:0:ac27:b86c:7764:9429]) by smtp.gmail.com with ESMTPSA id c7sm62390226wjk.19.2016.10.18.05.14.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Oct 2016 05:14:07 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Subject: [PATCH 05/10] dim: support git worktree for aux checkouts Date: Tue, 18 Oct 2016 14:13:51 +0200 Message-Id: <20161018121356.9594-5-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161018121356.9594-1-daniel.vetter@ffwll.ch> References: <20161018121356.9594-1-daniel.vetter@ffwll.ch> Cc: Daniel Vetter , DRI Development , Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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