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 }