All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: DRI Development <dri-devel@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: [PATCH 18/18] dim: Make update_linux_next multi-repo compliant
Date: Fri, 21 Oct 2016 21:37:00 +0200	[thread overview]
Message-ID: <20161021193700.22100-19-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20161021193700.22100-1-daniel.vetter@ffwll.ch>

- Only update the for-linux-next branches in the repo for the branch
  just pushed.
- Roll out the same logic (to allow us to always merge feature
  patches) for drm-misc.

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

diff --git a/dim b/dim
index f42b1eebf48b..f7e814878a18 100755
--- a/dim
+++ b/dim
@@ -249,30 +249,43 @@ function map_nightly_remote
 	get_remote_name $remote_url
 }
 
-function update_linux_next
+# update for-linux-next and for-linux-next-fixes branches
+function update_linux_next # branch next next-fixes fixes
 {
 	cd $DIM_PREFIX/drm-tip
+	local branch=$1
+	local linux_next=$2
+	local linux_next_fixes=$3
+	local linux_fixes=$4
 
-	local nightly_origin=`map_nightly_remote origin`
+	source $DIM_PREFIX/drm-rerere/nightly.conf
+
+	local nightly_remote=`get_nightly_remote_for_branch $branch`
+
+	if [[ $nightly_remote != `get_nightly_remote_for_branch $linux_next` ]] ; then
+		return
+	fi
+
+	local remote=`map_nightly_remote $nightly_remote`
 
 	# always update drm-intel-fixes
-	echo -n "Pushing drm-intel-fixes to for-linux-next-fixes... "
-	git push $DRY_RUN $nightly_origin +$nightly_origin/drm-intel-fixes:for-linux-next-fixes >& /dev/null
+	echo -n "Pushing $linux_fixes to for-linux-next-fixes... "
+	git push $DRY_RUN $remote +$remote/$linux_fixes:for-linux-next-fixes # >& /dev/null
 	echo "Done."
 
-	if git merge-base --is-ancestor $nightly_origin/drm-intel-next-fixes $nightly_origin/drm-intel-fixes ; then
+	if git merge-base --is-ancestor $remote/$linux_next_fixes $remote/$linux_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 $nightly_origin +$nightly_origin/drm-intel-next-queued:for-linux-next >& /dev/null
+		echo -n "Out of merge window. Pushing $linux_next to for-linux-next... "
+		git push $DRY_RUN $remote +$remote/$linux_next:for-linux-next >& /dev/null
 		echo "Done."
 	else
 		# dinf is ahead of -fixes, i.e. drm-next has already closed for
 		# the next merge window and we've started to gather new fixes
 		# for the current -next cycle. Push dinf
 
-		echo -n "Pushing drm-intel-next-fixes to for-linux-next... "
-		git push $DRY_RUN $nightly_origin +$nightly_origin/drm-intel-next-fixes:for-linux-next >& /dev/null
+		echo -n "Pushing $linux_next_fixes to for-linux-next... "
+		git push $DRY_RUN $remote +$remote/$linux_next_fixes:for-linux-next >& /dev/null
 		echo "Done."
 	fi
 }
@@ -428,8 +441,6 @@ function dim_rebuild_nightly
 		echo "Fail: Branch setup for the rerere-cache is borked."
 		exit 1
 	fi
-
-	update_linux_next
 }
 
 # push branch $1, rebuild nightly. the rest of the arguments are passed to git
@@ -450,6 +461,9 @@ function dim_push_branch
 
 	git push $DRY_RUN $remote $branch "$@"
 
+	update_linux_next $branch drm-intel-next-queued drm-intel-next-fixes drm-intel-fixes
+	update_linux_next $branch drm-misc-next drm-misc-next-fixes drm-misc-fixes
+
 	dim_rebuild_nightly
 }
 
@@ -683,6 +697,24 @@ function dim_create_branch
 	$DRY git commit --quiet -m "Adding $branch to -nightly"
 }
 
+function get_nightly_remote_for_branch
+{
+	local branch=$1
+
+	for tree in $nightly_branches; do
+		local nightly_branch=${tree%:*}
+		local nightly_remote=${nightly_branch%%/*}
+		nightly_branch=${nightly_branch#*/}
+
+		if [[ $nightly_branch == $branch ]] ; then
+			nightly_remote=$nightly_remote
+			echo $nightly_remote
+		fi
+	done
+
+	echo ""
+}
+
 function dim_remove_branch
 {
 	if [[ "x$1" = "x" ]]; then
@@ -707,18 +739,7 @@ function dim_remove_branch
 
 	source $DIM_PREFIX/drm-rerere/nightly.conf
 
-	local nightly_remote=""
-
-	for tree in $nightly_branches; do
-		local nightly_branch=${tree%:*}
-		local nightly_remote=${nightly_branch%%/*}
-		nightly_branch=${nightly_branch#*/}
-
-		if [[ $nightly_branch == $branch ]] ; then
-			nightly_remote=$nightly_remote
-			break
-		fi
-	done
+	local nightly_remote=`get_nightly_remote_for_branch $branch`
 
 	if [[ $nightly_remote == "" ]] ; then
 		echoerr "$branch not found in nightly.conf"
-- 
2.9.3

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

      parent reply	other threads:[~2016-10-21 19:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-21 19:36 [PATCH 00/18] dim: split out drm-misc/tip.git Daniel Vetter
2016-10-21 19:36 ` [PATCH 01/18] dim: Extract TODO Daniel Vetter
2016-10-21 19:36 ` [PATCH 02/18] dim: Autocheck for up-to-dateness Daniel Vetter
2016-10-21 19:36 ` [PATCH 03/18] dim: echoerr helper for printing to stderr Daniel Vetter
2016-10-21 19:36 ` [PATCH 04/18] dim: autodetect remotes, first part for dim_setup Daniel Vetter
2016-10-21 19:36 ` [PATCH 05/18] dim: support git worktree for aux checkouts Daniel Vetter
2016-10-21 19:36 ` [PATCH 06/18] dim: Nuke nightly-forget Daniel Vetter
2016-10-21 19:36 ` [PATCH 07/18] dim: autodetect branches in rebuild-nightly Daniel Vetter
2016-10-21 19:36 ` [PATCH 08/18] dim: remove integration-tree remotes Daniel Vetter
2016-10-21 19:36 ` [PATCH 09/18] dim: Split out drm-nightly.git Daniel Vetter
2016-10-21 19:36 ` [PATCH 10/18] dim: s/drm-nightly/drm-tip Daniel Vetter
2016-10-21 19:36 ` [PATCH 11/18] dim: use git branch --list Daniel Vetter
2016-10-21 19:36 ` [PATCH 12/18] dim: add revert-rerere Daniel Vetter
2016-10-21 19:36 ` [PATCH 13/18] dim: use get_maintainers.pl in dim fixes Daniel Vetter
2016-10-21 19:36 ` [PATCH 14/18] dim-update-next: Update DRIVER_TIMESTAMP Daniel Vetter
2016-10-21 19:36 ` [PATCH 15/18] dim: support multiple remotes for branches Daniel Vetter
2016-10-21 19:36 ` [PATCH 16/18] dim: remove DIM_DRM_UPSTREAM_REMOTE config var Daniel Vetter
2016-10-21 19:36 ` [PATCH 17/18] dim: Adapat create/remove-branch Daniel Vetter
2016-10-21 19:37 ` Daniel Vetter [this message]

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=20161021193700.22100-19-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --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.