From patchwork Fri Dec 14 13:38:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10731175 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 F20985DE2 for ; Fri, 14 Dec 2018 13:39:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E11752D49D for ; Fri, 14 Dec 2018 13:39:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D56772D4A0; Fri, 14 Dec 2018 13:39:19 +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 9B1522D49D for ; Fri, 14 Dec 2018 13:39:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C3E546F4D1; Fri, 14 Dec 2018 13:39:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 38C6D6F4D0; Fri, 14 Dec 2018 13:39:09 +0000 (UTC) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181214133900euoutp015a410b1181a92e2ffaf1bbdc22fcbc8c~wNqHCFdxw0778207782euoutp01m; Fri, 14 Dec 2018 13:39:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181214133900euoutp015a410b1181a92e2ffaf1bbdc22fcbc8c~wNqHCFdxw0778207782euoutp01m Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181214133859eucas1p2b4dbba6150f36abd2510164c09f5f13e~wNqGJQ6060664806648eucas1p28; Fri, 14 Dec 2018 13:38:59 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 65.B6.04441.372B31C5; Fri, 14 Dec 2018 13:38:59 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181214133858eucas1p246b5e27c29bd93f23768bc6fab1404ab~wNqFgR6pL0610306103eucas1p21; Fri, 14 Dec 2018 13:38:58 +0000 (GMT) X-AuditID: cbfec7f2-5e3ff70000001159-0d-5c13b27367bc Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id E3.17.04284.272B31C5; Fri, 14 Dec 2018 13:38:58 +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:58 +0000 (GMT) From: Andrzej Hajda To: dri-devel@lists.freedesktop.org, dim-tools@lists.freedesktop.org Subject: [maintainer-tools PATCH RFC 1/3] dim: allow git_dir to specify arbitrary work directory Date: Fri, 14 Dec 2018 14:38:50 +0100 Message-id: <20181214133852.19665-2-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181214133852.19665-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprEIsWRmVeSWpSXmKPExsWy7djP87rFm4RjDP78FrG4te4cq8XGGetZ LbZ3PGe0uPL1PZvF2iN32R1YPe53H2fy6NuyijGAKYrLJiU1J7MstUjfLoEr48/yy6wFjawV G89/YWxgfMrcxcjJISFgIrH+TyN7FyMXh5DACkaJ1vkTWCCcz4wSNzZMY+pi5IComisPEV/G KPF32x9mCOc/o8SxLzdZQEaxCWhK/N18kw3EFhFwkbj14zHYJGaBHkaJudcbwPYJCyRJfP75 hRXEZhFQlWi9dxWsgVfAQuLehhZ2iJvkJVZvOABWzylgKXF883xGkEESAk9ZJSbuucMCUeQi cfPSaagGYYlXx7dA2TISnR0HmSDseommmVeYIZo7GCVOLF7OBpGwljh8/CLYFcwCfBKTtk1n hviTV6KjTQiixENi1bfpUG8CfbD+ySK2CYySCxgZVjGKp5YW56anFhvmpZbrFSfmFpfmpesl 5+duYgTG1Ol/xz/tYPx6KekQowAHoxIPb8YkoRgh1sSy4srcQ4wSHMxKIrxhrcIxQrwpiZVV qUX58UWlOanFhxilOViUxHmrGR5ECwmkJ5akZqemFqQWwWSZODilGhitu3qeTu4QUVN5uGr2 Fb/Ct9c494bND49aVv34yz3eaVMPPo+4bVTmmp3dduqX3qkwVn2Ga5dPBXPIvnE7oHPid4Bh sNLRPfck7GbetFi6MLlRRMq7WzR9k7Bio/qXRWGWezXYOK8n7fo/1ePJ5EOt+yc+brBczrbs osFJYzWuvT/XTzLbPPeqEktxRqKhFnNRcSIAxVC+iqUCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHJMWRmVeSWpSXmKPExsVy+t/xy7pFm4RjDK69N7O4te4cq8XGGetZ LbZ3PGe0uPL1PZvF2iN32R1YPe53H2fy6NuyijGAKYrLJiU1J7MstUjfLoEr48/yy6wFjawV G89/YWxgfMrcxcjBISFgIrF+rnwXIyeHkMASRol5s8W6GLmA7EYmid6ZU1hBEmwCmhJ/N99k A7FFBFwkbv14zAJSxCzQxyjR+HcVWEJYIEni888vYA0sAqoSrfeugsV5BSwk7m1oYQexJQTk JVZvOMAMYnMKWEoc3zyfEWKzhcShdbvZJjDyLGBkWMUoklpanJueW2yoV5yYW1yal66XnJ+7 iREYCtuO/dy8g/HSxuBDjAIcjEo8vAemCMUIsSaWFVfmHmKU4GBWEuENaxWOEeJNSaysSi3K jy8qzUktPsQozcGiJM573qAySkggPbEkNTs1tSC1CCbLxMEp1cA4p2Lnlkz2w2nzJ2/RffVM a86ZpnxHeQVebQ6hkJZDS7dEPhFf8/zkjuT2c3d5S3MMNqmuv+5x/cLF4v0CXVcrbna+7pI6 H/1yTpAZz5eARTekg9dc+Jpv9iz1yiyGk+J+V0qm7qs8MdWj0M4zZm6Q9IQO98zZrKffMe5Y elQ7+U75qVkcO89nK7EUZyQaajEXFScCAE3mZzIBAgAA X-CMS-MailID: 20181214133858eucas1p246b5e27c29bd93f23768bc6fab1404ab X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181214133858eucas1p246b5e27c29bd93f23768bc6fab1404ab 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 git_dir function returns git directory for current working directory. Allowing specifying any directory allows to reuse it more widely. Signed-off-by: Andrzej Hajda --- dim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dim b/dim index 70939ff..df66c58 100755 --- a/dim +++ b/dim @@ -565,10 +565,12 @@ function rr_cache_dir function git_dir { - if [ -d $PWD/.git ] ; then - echo $PWD/.git + local dir=${1:-$PWD} + + if [ -d $dir/.git ] ; then + echo $dir/.git else - cut -d ' ' -f 2 < $PWD/.git + cut -d ' ' -f 2 < $dir/.git fi } 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-Tracker: H4sIAAAAAAAAA+NgFprMIsWRmVeSWpSXmKPExsWy7djP87rFm4RjDH6u07O4te4cq8XGGetZ LbZ3PGe0uPL1PZvF2iN32R1YPe53H2fy6NuyijGAKYrLJiU1J7MstUjfLoEro2P1HaaCGXwV /Q+OszUwbuXuYuTkkBAwkfi6Yy5LFyMXh5DACkaJO+uPs0I4nxklpq06xApTteBaAxNEYhmj xLJbHewQzn9Gif/bWtlAqtgENCX+br4JZosIuEjc+vEYbC6zQA+jxNzrDcwgCWEBT4ktWyeC 2SwCqhJdR6+wgNi8AhYS69e/gFonL7F6wwGwGk4BS4njm+czggySEHjKKvFq001GiCIXibfz z7NA2MISr45vYYewZSQuT+6GitdLNM28wgzR3MEocWLxcjaIhLXE4eMXwbYxC/BJTNo2HaiI AyjOK9HRJgRR4iFx58wXZog3gT7Y8GwC+wRGyQWMDKsYxVNLi3PTU4uN8lLL9YoTc4tL89L1 kvNzNzECo+r0v+NfdjDu+pN0iFGAg1GJhzdjklCMEGtiWXFl7iFGCQ5mJRHesFbhGCHelMTK qtSi/Pii0pzU4kOM0hwsSuK81QwPooUE0hNLUrNTUwtSi2CyTBycUg2MPZ/jc28cUuDbNtV0 fcu8Vcozlq2ZG9zwtrHr8vmrETxSlvsXi6qxX3327rVbxIb1Lbcr5E6I8h8662B/J9y859bu kyvzItNiozx5+bJmOydlyM3f6rV6XqZVYKtmkkgLy312g8f765XK5FZPf7z95LfIlZM+FP7g ZxGvYxfjm/UkxuGpz+ZmJZbijERDLeai4kQAt9tf+aYCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPJMWRmVeSWpSXmKPExsVy+t/xy7rFm4RjDCav4bW4te4cq8XGGetZ LbZ3PGe0uPL1PZvF2iN32R1YPe53H2fy6NuyijGAKYrLJiU1J7MstUjfLoEro2P1HaaCGXwV /Q+OszUwbuXuYuTkkBAwkVhwrYGpi5GLQ0hgCaPE/P6rrCAJIYFGJonXjQIgNpuApsTfzTfZ QGwRAReJWz8es4A0MAv0MUo0/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" From patchwork Fri Dec 14 13:38:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10731171 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 0E3865DE2 for ; Fri, 14 Dec 2018 13:39:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F274E2D49D for ; Fri, 14 Dec 2018 13:39:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E67302D4A0; Fri, 14 Dec 2018 13:39:16 +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 EB7632D49D for ; Fri, 14 Dec 2018 13:39:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A05596F4DE; Fri, 14 Dec 2018 13:39:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 364FA6F4CE; Fri, 14 Dec 2018 13:39:09 +0000 (UTC) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181214133900euoutp01b6fd28cbbde0e0412fa5a6e494e364c9~wNqHUIhLE0784307843euoutp01e; Fri, 14 Dec 2018 13:39:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181214133900euoutp01b6fd28cbbde0e0412fa5a6e494e364c9~wNqHUIhLE0784307843euoutp01e Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181214133900eucas1p240f84b464bc468c595b9c76fd1f4d33f~wNqG2uqWj0610306103eucas1p22; 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 00.78.04294.472B31C5; Fri, 14 Dec 2018 13:39:00 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181214133859eucas1p2354f9ece984a7c97c3b4dcd720439657~wNqGKRVUr1012110121eucas1p2F; Fri, 14 Dec 2018 13:38:59 +0000 (GMT) X-AuditID: cbfec7f4-c77a99c0000010c6-8f-5c13b2746597 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id E4.17.04284.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 3/3] dim: fix rr_cache_dir discovery Date: Fri, 14 Dec 2018 14:38:52 +0100 Message-id: <20181214133852.19665-4-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181214133852.19665-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprEIsWRmVeSWpSXmKPExsWy7djP87olm4RjDJbOZbO4te4cq8XGGetZ LbZ3PGe0uPL1PZvF2iN32R1YPe53H2fy6NuyijGAKYrLJiU1J7MstUjfLoErY/Iu4YKnnBWH 5zSxNDDeY+9i5OSQEDCROLR5PUsXIxeHkMAKRok/s/oYIZzPjBLdv9rYYKouzv7HBpFYxigx 4RJM1X9Gif/bWsGq2AQ0Jf5uvglmiwi4SNz68RhsLrNAD6PE3OsNzCAJYQFPiaZnv5hAbBYB VYlbXTNZQWxeAQuJtY9+sUKsk5dYveEAWD2ngKXE8c3zwbZJCDxklXgybzXUTS4SC19/YoGw hSVeHd8C9ZGMRGfHQSYIu16iaeYVZojmDkaJE4uXQzVbSxw+fhFsG7MAn8SkbdOBijiA4rwS HW1CECUeEtsOrIP6GeiD5X0r2CYwSi5gZFjFKJ5aWpybnlpslJdarlecmFtcmpeul5yfu4kR GFOn/x3/soNx15+kQ4wCHIxKPLwZk4RihFgTy4orcw8xSnAwK4nwhrUKxwjxpiRWVqUW5ccX leakFh9ilOZgURLnrWZ4EC0kkJ5YkpqdmlqQWgSTZeLglGpgjH3SdyvXj3N2zM5scb9VzB8L u5/dvDyB0ffndoMTkap7Z157uE53roL6CSGbHR1KztftzrTM2OFjbP76X8TmAKGQzGeOe5xn 5b25+zM067KiycWE/mtR98R3XNiyItyiyNx2S0OwaX5SnHpV/cvXgpxPm6e17a4rSo01uevi /2bd7Pmf17kcVWIpzkg01GIuKk4EAPQDZYSlAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHJMWRmVeSWpSXmKPExsVy+t/xy7rFm4RjDKZ+UbC4te4cq8XGGetZ LbZ3PGe0uPL1PZvF2iN32R1YPe53H2fy6NuyijGAKYrLJiU1J7MstUjfLoErY/Iu4YKnnBWH 5zSxNDDeY+9i5OSQEDCRuDj7H1sXIxeHkMASRoltC+ewgSSEBBqZJF43CoDYbAKaEn833wSL iwi4SNz68ZgFpIFZoI9RovHvKrCEsICnRNOzX0wgNouAqsStrpmsIDavgIXE2ke/WCG2yUus 3nCAGcTmFLCUOL55PiPEMguJQ+t2s01g5FnAyLCKUSS1tDg3PbfYUK84Mbe4NC9dLzk/dxMj MBS2Hfu5eQfjpY3BhxgFOBiVeHgPTBGKEWJNLCuuzD3EKMHBrCTCG9YqHCPEm5JYWZValB9f VJqTWnyIUZqDRUmc97xBZZSQQHpiSWp2ampBahFMlomDU6qBUboyX6bo5qYfrzP4U/7Nvqv4 pu2JPd+BDeZRpreYqyaL9Fyc+sX8IEPqHkc+jleP9db9NvO+vls8dpl2yNtlIbe1H7P4LUyc 4rz5ya4K/c3qCq7r+Q7XzZta8uDct6znc/W92+/aXb99QqFUSOfWtp67wWEz5NiETBrYojjy A2wNL72R8NJ/qsRSnJFoqMVcVJwIAJ5TdgUBAgAA X-CMS-MailID: 20181214133859eucas1p2354f9ece984a7c97c3b4dcd720439657 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181214133859eucas1p2354f9ece984a7c97c3b4dcd720439657 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 rr_cache_dir function cannot assume REPO/.git is a directory. On the other side it should be backward compatible - if rr-cache directory/link already exists it should be returned. Signed-off-by: Andrzej Hajda --- Hi, I am not sure of the purpose of rr-cache symbolic link, dim does not use it (except its creation/removal). So this patch should be verified by someone who knows better what is going on here. Regards Andrzej --- dim | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/dim b/dim index 3afa8b6..b72ebfd 100755 --- a/dim +++ b/dim @@ -554,15 +554,6 @@ function check_conflicts # tree true } -function rr_cache_dir -{ - if [ -d $DIM_PREFIX/drm-tip/.git/ ] ; then - echo $DIM_PREFIX/drm-tip/.git/rr-cache - else - echo $DIM_PREFIX/$DIM_REPO/.git/rr-cache - fi -} - function git_dir { local dir=${1:-$PWD} @@ -574,6 +565,17 @@ function git_dir fi } +function rr_cache_dir +{ + local dir=$(git_dir $DIM_PREFIX/$DIM_REPO)/rr-cache + + if [ -d $dir ]; then + echo $dir + else + echo $(git_dir $DIM_PREFIX/drm-tip)/rr-cache + fi +} + function pull_rerere_cache { cd $DIM_PREFIX/drm-rerere/