All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: [PATCH 4/5] dim: autodetect branches in rebuild-nightly
Date: Fri, 11 Nov 2016 15:36:44 +0100	[thread overview]
Message-ID: <20161111143645.817-4-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20161111143645.817-1-daniel.vetter@ffwll.ch>

Needs new url-mapping information in nightly.conf to work properly. Only
leftover bit from my original patch after rebasing is to abstract away
the remote for the integration tree.

v2:
- Fix typo when calling rr_cache_dir. Oops.
- Use cut -f 1 instead of sed/regex horrors (jani).

v3: Fix bug that resulted in nesting rr-cache directories.

v4: Rebasing.

v5: Resurrect $repo (as $remote) printing when fetching branches,
originally from my patch.

v6: Use remote instead of origin local variables, to be more
consistent. Picked up from Jani.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 dim | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/dim b/dim
index 5d6cc37eb374..30aa8485e50b 100755
--- a/dim
+++ b/dim
@@ -261,16 +261,18 @@ function update_linux_next
 {
 	cd $DIM_PREFIX/drm-intel-nightly
 
+	local remote=${drm_tip_repos[drm-intel]}
+
 	# always update drm-intel-fixes
 	echo -n "Pushing drm-intel-fixes to for-linux-next-fixes... "
-	git push $DRY_RUN origin +origin/drm-intel-fixes:for-linux-next-fixes >& /dev/null
+	git push $DRY_RUN $remote +$remote/drm-intel-fixes:for-linux-next-fixes >& /dev/null
 	echo "Done."
 
-	if git merge-base --is-ancestor origin/drm-intel-next-fixes origin/drm-intel-fixes ; then
+	if git merge-base --is-ancestor $remote/drm-intel-next-fixes $remote/drm-intel-fixes ; then
 		# -fixes has caught up to dinf, i.e. we're out of the merge
 		# window. Push the next queue.
 		echo -n "Out of merge window. Pushing drm-intel-next-queued to for-linux-next... "
-		git push $DRY_RUN origin +origin/drm-intel-next-queued:for-linux-next >& /dev/null
+		git push $DRY_RUN $remote +$remote/drm-intel-next-queued:for-linux-next >& /dev/null
 		echo "Done."
 	else
 		# dinf is ahead of -fixes, i.e. drm-next has already closed for
@@ -278,7 +280,7 @@ function update_linux_next
 		# for the current -next cycle. Push dinf
 
 		echo -n "Pushing drm-intel-next-fixes to for-linux-next... "
-		git push $DRY_RUN origin +origin/drm-intel-next-fixes:for-linux-next >& /dev/null
+		git push $DRY_RUN $remote +$remote/drm-intel-next-fixes:for-linux-next >& /dev/null
 		echo "Done."
 	fi
 }
@@ -346,9 +348,10 @@ function dim_rebuild_nightly
 		exit 1
 	fi
 
-	for url in "${drm_tip_repos[@]}"; do
+	for repo in "${!drm_tip_repos[@]}"; do
+		local url=${drm_tip_repos[$repo]}
 		local remote=$(url_to_remote $url)
-		echo -n "Fetching $remote... "
+		echo -n "Fetching $repo (as $remote) ... "
 		# git fetch returns 128 if there's nothing to be fetched
 		git fetch $remote >& /dev/null || true
 		echo "Done."
@@ -369,8 +372,8 @@ function dim_rebuild_nightly
 		fi
 
 		if [ $first == 1 ] ; then
+			git reset --hard $sha1 &> /dev/null
 			echo "Reset. Done."
-			git reset --hard $sha1 >& /dev/null
 			first=0
 		elif git merge --rerere-autoupdate --ff-only $sha1 >& /dev/null ; then
 			# nothing to do if just fast-forward
@@ -405,8 +408,10 @@ function dim_rebuild_nightly
 	git commit --quiet -m "$integration_branch: $time integration manifest"
 	echo "Done."
 
+	local nightly_remote=${drm_tip_repos[drm-intel]}
+
 	echo -n "Pushing $integration_branch... "
-	git push $DRY_RUN origin +HEAD >& /dev/null && echo "Done."
+	git push $DRY_RUN $nightly_remote +HEAD >& /dev/null && echo "Done."
 
 	echo -n "Updating rerere cache... "
 	cd $rerere
@@ -421,7 +426,7 @@ function dim_rebuild_nightly
 			echo -n "Nothing changed. "
 		fi
 		echo -n "Pushing rerere cache... "
-		git push $DRY_RUN origin HEAD >& /dev/null && echo "Done."
+		git push $DRY_RUN $nightly_remote HEAD >& /dev/null && echo "Done."
 	else
 		echo "Fail: Branch setup for the rerere-cache is borked."
 		exit 1
-- 
2.10.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-11-11 14:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-11 14:36 [PATCH 1/5] dim: Fixup remove-branch for working-trees Daniel Vetter
2016-11-11 14:36 ` [PATCH 2/5] dim: autodetect remotes, first part for dim_setup Daniel Vetter
2016-11-11 14:36 ` [PATCH 3/5] dim: support git worktree for aux checkouts Daniel Vetter
2016-11-11 14:36 ` Daniel Vetter [this message]
2016-11-11 14:36 ` [PATCH 5/5] dim: Improve the error output when rebuild-nightly fails 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=20161111143645.817-4-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.