dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Hajda <a.hajda@samsung.com>
To: dri-devel@lists.freedesktop.org, dim-tools@lists.freedesktop.org
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: [maintainer-tools PATCH v2 3/4] dim: fix update_rerere_cache
Date: Tue, 18 Dec 2018 11:30:15 +0100	[thread overview]
Message-ID: <20181218103016.8070-4-a.hajda@samsung.com> (raw)
In-Reply-To: <20181218103016.8070-1-a.hajda@samsung.com>

update_rerere_cache does not work correctly if drm-tip and $DIM_REPO are
workdirs - it cannot locate properly rr-cache. Let's use git rev-parse
to resolve rr-cache location.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
 dim | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/dim b/dim
index 3afa8b6..e4a4afe 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}
@@ -606,17 +597,25 @@ function pull_rerere_cache
 
 function update_rerere_cache
 {
+	local rr_cache_dir
+
 	echo -n "Updating rerere cache... "
 
 	pull_rerere_cache
 
-	if [ ! -L $(rr_cache_dir) ] ; then
-		if [ -d $(rr_cache_dir) ] ; then
-			rm -Rf $(rr_cache_dir)
+	cd $DIM_PREFIX/drm-tip/
+
+	rr_cache_dir=$(git rev-parse --git-common-dir)/rr-cache
+
+	if [ ! -L $rr_cache_dir ] ; then
+		if [ -d $rr_cache_dir ] ; then
+			rm -Rf $rr_cache_dir
 		fi
-		ln -s "$DIM_PREFIX/drm-rerere/rr-cache" $(dirname $(rr_cache_dir))
+		ln -s "$DIM_PREFIX/drm-rerere/rr-cache" $rr_cache_dir
 	fi
 
+	cd ~-
+
 	echo "Done."
 }
 
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2018-12-18 10:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20181218103020eucas1p144a1da4116ddbf8a06eb2846e88236d5@eucas1p1.samsung.com>
2018-12-18 10:30 ` [maintainer-tools PATCH v2 0/4] dim: fix git directory evaluation Andrzej Hajda
2018-12-18 10:30   ` [maintainer-tools PATCH v2 1/4] dim: allow git_dir to specify arbitrary work directory Andrzej Hajda
2018-12-18 10:30   ` [maintainer-tools PATCH v2 2/4] dim: fix git directory handling Andrzej Hajda
2018-12-18 10:30   ` Andrzej Hajda [this message]
2018-12-18 10:30   ` [maintainer-tools PATCH v2 4/4] dim: use git rev-parse to get git directory Andrzej Hajda
2018-12-18 12:33   ` [maintainer-tools PATCH v2 0/4] dim: fix git directory evaluation Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181218103016.8070-4-a.hajda@samsung.com \
    --to=a.hajda@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=dim-tools@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=m.szyprowski@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox