From patchwork Fri Dec 14 13:38:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10731173 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 203AA5DE2 for ; Fri, 14 Dec 2018 13:39:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FA352D49D for ; Fri, 14 Dec 2018 13:39:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 042B82D4A0; Fri, 14 Dec 2018 13:39:18 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 B19BE2D49D for ; Fri, 14 Dec 2018 13:39:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 513EC6F4E4; Fri, 14 Dec 2018 13:39:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1A10B6F25A; Fri, 14 Dec 2018 13:39:08 +0000 (UTC) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181214133900euoutp0254e573abfa87d58a65a5e2091e051ac3~wNqHHDW1_2379723797euoutp02E; Fri, 14 Dec 2018 13:39:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181214133900euoutp0254e573abfa87d58a65a5e2091e051ac3~wNqHHDW1_2379723797euoutp02E Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181214133900eucas1p1d6372f59781c350bee3570f94ae70151~wNqGsxN5Z1566715667eucas1p17; Fri, 14 Dec 2018 13:39:00 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 5F.68.04294.372B31C5; Fri, 14 Dec 2018 13:38:59 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181214133859eucas1p1e332646e04d00c4256e36403b28e07ee~wNqFzyYPi1566715667eucas1p16; Fri, 14 Dec 2018 13:38:59 +0000 (GMT) X-AuditID: cbfec7f4-c77a99c0000010c6-8c-5c13b2734491 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 78.1C.04128.372B31C5; Fri, 14 Dec 2018 13:38:59 +0000 (GMT) Received: from AMDC3748.DIGITAL.local ([106.120.43.17]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PJQ007PHB8Y1V20@eusync1.samsung.com>; Fri, 14 Dec 2018 13:38:59 +0000 (GMT) From: Andrzej Hajda To: dri-devel@lists.freedesktop.org, dim-tools@lists.freedesktop.org Subject: [maintainer-tools PATCH RFC 2/3] dim: fix git directory handling Date: Fri, 14 Dec 2018 14:38:51 +0100 Message-id: <20181214133852.19665-3-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181214133852.19665-1-a.hajda@samsung.com> X-Brightmail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z8es4A0MAv0MUo0/l0FlhAW8JTYsnUiM4jNIqAq0XX0CguIzStgIbF+/QtWiG3y Eqs3HACr4RSwlDi+eT4jxDILiUPrdrNNYORZwMiwilEktbQ4Nz232EivODG3uDQvXS85P3cT IzAYth37uWUHY9e74EOMAhyMSjy8B6YIxQixJpYVV+YeYpTgYFYS4Q1rFY4R4k1JrKxKLcqP LyrNSS0+xCjNwaIkznveoDJKSCA9sSQ1OzW1ILUIJsvEwSnVwLhl48GavDZ2o8gpIrxzSibz nBPa9VVi3qLm5aeP8CXK7OvT+DEr81WMB/P5JXtW55UksiS0uvPsvrBBc/PHs5eD5q1+Ocv9 sLTzsX2PVRcUh32Stf+xNO/RlBiP+c9ZJm/f6Odkejxr14EfOTVb2e9qXLdYuV1ynktj3zE3 VZ0zc45HXCy/z9ujxFKckWioxVxUnAgAjmWPzwICAAA= X-CMS-MailID: 20181214133859eucas1p1e332646e04d00c4256e36403b28e07ee X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181214133859eucas1p1e332646e04d00c4256e36403b28e07ee References: <20181214133852.19665-1-a.hajda@samsung.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Szyprowski , Bartlomiej Zolnierkiewicz MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Assumption that git directory is always located at REPO/.git is incorrect, especially in case of git worktrees. There is already function to deal with it correctly - git_dir, let's then use it. Signed-off-by: Andrzej Hajda --- dim | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/dim b/dim index df66c58..3afa8b6 100755 --- a/dim +++ b/dim @@ -1088,12 +1088,7 @@ function dim_backmerge git merge --rerere-autoupdate --no-commit $upstream >& /dev/null || true - if [[ -d .git ]]; then - patch_file=".git" - else - patch_file=$(cut -d ' ' -f 2 .git) - fi - patch_file=$patch_file/MERGE_MSG + patch_file=$(git_dir)/MERGE_MSG cat > $patch_file <<-HERE @@ -1340,7 +1335,7 @@ dim_alias_mrr=magic-rebase-resolve function dim_magic_rebase_resolve { git diff HEAD | patch -p1 -R - dim_magic_patch < .git/rebase-merge/patch + dim_magic_patch < $(git_dir)/rebase-merge/patch make $DIM_MAKE_OPTIONS git add -u git rebase --continue @@ -2102,7 +2097,7 @@ function setup_aux_checkout # name url directory git clone --reference=$DIM_PREFIX/$DIM_REPO/.git $url $dir cd $dir git config remote.origin.url $url - echo "$DIM_PREFIX/$DIM_REPO/.git/objects" > .git/objects/info/alternates + echo "$(git_dir $DIM_PREFIX/$DIM_REPO)/objects" > $(git_dir)/objects/info/alternates git repack -a -d -l remote=origin fi @@ -2132,7 +2127,7 @@ function dim_setup fi cd $DIM_PREFIX - if [ ! -d $DIM_PREFIX/$DIM_REPO/.git ]; then + if [ ! -d $(git_dir $DIM_PREFIX/$DIM_REPO) ]; then echoerr "No git checkout found in $DIM_PREFIX/$DIM_REPO." echoerr "Please set up your maintainer linux repository at $DIM_PREFIX/$DIM_REPO with" echoerr " cd $DIM_PREFIX"