dim: symbolic link for the rr-cache
diff mbox

Message ID 20170807085552.12151-1-daniel.vetter@ffwll.ch
State New
Headers show

Commit Message

Daniel Vetter Aug. 7, 2017, 8:55 a.m. UTC
After about a month and a few attempts it's clear that my rr-cache gc
logic is busted. When copying stuff back&forth between the git branch
and git's rr-cache dir, something somewhere (or maybe it's git rerere
itself) touches all files and wreaks the timestamps.

End result is that over this month, every time when someone gc'ed a
few files, they've been resurrected a few days later by someone else.

I think the only way to fix this is by dropping the copying and
replacing git's rr-cache with a symbolic link. That way, when we
delete an rr-cache entry in the git branch, it won't be able to
resurrect. I hope at least ...

This also makes dim revert-rerere no longer needed, delete it.

v2: Unfunny the ln option placement (Jani).

Acked-by: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
 dim     | 22 +++++++---------------
 dim.rst |  9 ---------
 2 files changed, 7 insertions(+), 24 deletions(-)

diff mbox

diff --git a/dim b/dim
index d52510529fa2..f8be76df4952 100755
--- a/dim
+++ b/dim
@@ -504,8 +504,13 @@  function update_rerere_cache
 	cd $DIM_PREFIX/drm-rerere/
 	git pull &> /dev/null
-	mkdir $(rr_cache_dir) &> /dev/null || true
-	cp rr-cache/* $(rr_cache_dir) -r --preserve=timestamps
+	if [ -d $(rr_cache_dir) ] ; then
+		rm -Rf $(rr_cache_dir)
+	fi
+	if [ ! -L $(rr_cache_dir) ] ; then
+		ln -s "$DIM_PREFIX/drm-rerere/rr-cache" $(dirname $(rr_cache_dir))
+	fi
 	cd - > /dev/null
 	echo "Done."
@@ -519,8 +524,6 @@  function commit_rerere_cache
 	if git_is_current_branch rerere-cache ; then
 		remote=$(branch_to_remote rerere-cache)
-		rm $(rr_cache_dir)/rr-cache -Rf &> /dev/null || true
-		cp $(rr_cache_dir)/* rr-cache -r --preserve=timestamps
 		git pull >& /dev/null
 		git add ./*.patch >& /dev/null || true
 		for file  in $(git ls-files); do
@@ -543,17 +546,6 @@  function commit_rerere_cache
-function dim_revert_rerere
-	local commit
-	commit=${1:?$usage}
-	cd $DIM_PREFIX/drm-rerere/
-	git revert $commit
-	rm $(rr_cache_dir)/* -Rf
 function dim_rebuild_tip
diff --git a/dim.rst b/dim.rst
index f012a831da74..a2c110a054ee 100644
--- a/dim.rst
+++ b/dim.rst
@@ -247,15 +247,6 @@  Rebuild and push the integration tree.
-revert-rerere *rerere-cache-commit-ish*
-When a stored conflict resolution in the integration tree is wrong, this command
-can be used to fix up the mess. First figure out which commit in the
-*rerere-cache* branch contains the bogus conflict resolution, then revert it
-using this command. This ensures the resolution is also purged from any local
-caches, to make sure it doesn't get resurrected. Then run *rebuild-tip* to redo
-the merges, correctly.
 Pipes stdin into the fixup patch file for the current drm-tip merge.