[PATCH 1/2] dim: Move all rerere updating into helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Just prep work.

Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx>
---
 dim | 61 ++++++++++++++++++++++++++++++++++---------------------------
 1 file changed, 34 insertions(+), 27 deletions(-)

diff --git a/dim b/dim
index ca11287535cc..b788edd29653 100755
--- a/dim
+++ b/dim
@@ -493,11 +493,41 @@ function rr_cache_dir
 
 function update_rerere_cache
 {
-	cd $DIM_PREFIX/drm-rerere/
+	echo -n "Updating rerere cache... "
+
 	git pull
 	mkdir $(rr_cache_dir) &> /dev/null || true
-	cp rr-cache/* $(rr_cache_dir) -r
+	cp rr-cache/* $(rr_cache_dir) -r --preserve=timestamps
 	cd - > /dev/null
+
+	echo "Done."
+}
+
+function commit_rerere_cache
+{
+	echo -n "Updating rerere cache... "
+
+	cd $DIM_PREFIX/drm-rerere/
+	if git_is_current_branch rerere-cache ; then
+		remote=$(branch_to_remote rerere-cache)
+
+		git pull >& /dev/null
+		rm $(rr_cache_dir)/rr-cache -Rf &> /dev/null || true
+		cp $(rr_cache_dir)/* rr-cache -r
+		git add ./*.patch >& /dev/null || true
+		git add rr-cache/* > /dev/null
+		git rm rr-cache/rr-cache &> /dev/null || true
+		if git commit -m "$time: $integration_branch rerere cache update" >& /dev/null; then
+			echo -n "New commit. "
+		else
+			echo -n "Nothing changed. "
+		fi
+		echo -n "Pushing rerere cache... "
+		git push $DRY_RUN $remote HEAD >& /dev/null && echo "Done."
+	else
+		echo "Fail: Branch setup for the rerere-cache is borked."
+		exit 1
+	fi
 }
 
 function dim_revert_rerere
@@ -528,9 +558,7 @@ function dim_rebuild_tip
 		warn_or_fail "integration configuration file $integration_config not commited"
 	fi
 
-	echo -n "Updating rerere cache... "
-	update_rerere_cache >& /dev/null
-	echo "Done."
+	update_rerere_cache
 
 	echo -n "Reloading $integration_config... "
 	read_integration_config
@@ -618,28 +646,7 @@ function dim_rebuild_tip
 	echo -n "Pushing $integration_branch... "
 	git push $DRY_RUN $remote +HEAD >& /dev/null && echo "Done."
 
-	echo -n "Updating rerere cache... "
-	cd $rerere
-	if git_is_current_branch rerere-cache ; then
-		remote=$(branch_to_remote rerere-cache)
-
-		git pull >& /dev/null
-		rm $(rr_cache_dir)/rr-cache -Rf &> /dev/null || true
-		cp $(rr_cache_dir)/* rr-cache -r
-		git add ./*.patch >& /dev/null || true
-		git add rr-cache/* > /dev/null
-		git rm rr-cache/rr-cache &> /dev/null || true
-		if git commit -m "$time: $integration_branch rerere cache update" >& /dev/null; then
-			echo -n "New commit. "
-		else
-			echo -n "Nothing changed. "
-		fi
-		echo -n "Pushing rerere cache... "
-		git push $DRY_RUN $remote HEAD >& /dev/null && echo "Done."
-	else
-		echo "Fail: Branch setup for the rerere-cache is borked."
-		exit 1
-	fi
+	commit_rerere_cache
 }
 
 # additional patch checks before pushing, e.g. for r-b tags
-- 
2.13.2

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




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux