All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] dim: Update docs
@ 2017-01-26  9:10 Daniel Vetter
  2017-01-26  9:10 ` [PATCH 2/6] dim: don't check everything in dim setup Daniel Vetter
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Daniel Vetter @ 2017-01-26  9:10 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

- Remove branch overview, instead link to drm-intel and drm-misc
  pages.

- Move quickstart to the top, to make it easier to find.

- Make quickstart generic, we use dim for other stuff than drm-intel
  now.

- s/drm-intel-rerere/drm-rerere/

- Remove the section about resolving conflicts, that's now explained
  in detail in the process pages.

v2: Also eradicate dinq (Laurent).

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 dim.rst | 138 ++++++++++++++++++++++++----------------------------------------
 1 file changed, 51 insertions(+), 87 deletions(-)

diff --git a/dim.rst b/dim.rst
index b9cb41a2ba5b..97b375e34e90 100644
--- a/dim.rst
+++ b/dim.rst
@@ -23,40 +23,66 @@ DESCRIPTION
 
 drm-intel maintainer script.
 
-Branch Model
-------------
+Used to maintain drm-intel_ and drm-misc_ git repositories.
 
-The dim flow has 3 main development branches:
+.. _drm-intel: drm-intel.html
+.. _drm-misc: drm-misc.html
 
-- drm-intel-next-queued for feature work. This branch gets regularly pushed to
-  drm-intel-next and tagged and then sent on to the upstream drm-next branch
-  using *update-next*.  The cut-off for the last pull request to drm-next is
-  around -rc5. After that point patches in drm-intel-next-queued already aim at
-  the next but one and not the next merge window.
+QUICKSTART
+==========
 
-- drm-intel-next-fixes is to collect fixes for the current merge window after
-  the -rc5 feature cut-off in drm-next.
+For getting started grab the latest drm (drm-intel-maintainer) script from::
 
-- drm-intel-fixes is for fixes for the current -rc1 kernel. This is separate
-  from drm-intel-next-fixes since the merge window feature cutoff at -rc5 is a
-  few weeks ahead of the final release of the previous kernel.
+    http://cgit.freedesktop.org/drm-intel/tree/dim?h=maintainer-tools
 
-  There's separate tracking branches for inclusion into linux-next to make sure
-  that the feature work in drm-intel-next-queued aimed for the next but one
-  merge window doesn't cause unecassary conflicts in linux-next - in that case
-  only drm-intel-next-fixes is included in linux-next. The switchover happens
-  when drm-intel-fixes has caught up (in git terms: drm-intel-next-fixes is
-  direct ancestor of drm-intel-fixes). Therefore only roll drm-intel-fixes
-  forward once -rc1 is released
+There's also a sample config file for ~/.dimrc::
 
-In addition there's 2 permanent topic branches:
+    http://cgit.freedesktop.org/drm-intel/tree/dimrc.sample?h=maintainer-tools
 
-- topic/drm-misc carries core drm patches aimed at the next merge window.
+Plus, there's bash completion in the same directory if you feel like using that.
+Run::
 
-- topic/drm-fixes carries core drm fixes for the current -rc kernels.
+    $ dim help
 
-Additional topic branches are created as needed using *create-branch* and
-*remove-branch*.
+for tons of details about how this thing works. Also see the git repository
+specific pages for details on the patch merging process for each tree. Adjust
+your .dimrc to match your setup and then run::
+
+    $ dim setup
+
+This will also check out the latest maintainer-tools branches, so please replace
+the dim you just downloaded with a symlink after this step. And by the way, if
+you have improvements for dim, please submit them to intel-gfx.
+
+You should now have a main repository for patch application. The directory
+corresponding to this repository is defined by DIM_DRM_INTEL in your .dimrc.
+You should also have directories called maintainer-tools, drm-tip (for
+rebuilding the tree), and drm-rerere for some dim-internal book-keeping.
+
+If someone else has pushed patches first resync using::
+
+   $ dim update-branches
+
+Since dim supports lots of different branches in different repositories you
+first need to check out the right branch using::
+
+   $ dim checkout <branch>
+
+Applying patches is done in the main repository with::
+
+    $ cat patch.mbox | dim apply-branch <branch>
+
+This works like a glorified version of git apply-mbox and does basic patch
+checking and adds stuff like patchwork links of the merged patch. It is
+preferred to use the patch email file instead of the original patch file since
+it contains some interesting headers like the message ID. When you're happy
+(remember that with a shared tree any mistake is permanent and there's no
+rebasing) push out the new tree with::
+
+    $ dim push-branch <branch>
+
+This will also rebuild a new drm-tip integration tree. For historical reasons
+there's shortcut for the drm-intel specific branches for most of these commands.
 
 OPTIONS
 =======
@@ -375,68 +401,6 @@ DIM_TEMPLATE_SIGNATURE
 ----------------------
 Path to a file containing a signature template for pull request mails.
 
-QUICKSTART
-==========
-
-For getting started grab the latest drm (drm-intel-maintainer) script from::
-
-    http://cgit.freedesktop.org/drm-intel/tree/dim?h=maintainer-tools
-
-There's also a sample config file for ~/.dimrc::
-
-    http://cgit.freedesktop.org/drm-intel/tree/dimrc.sample?h=maintainer-tools
-
-Plus, there's bash completion in the same directory if you feel like using that.
-Run::
-
-    $ dim help
-
-for tons of details about how this thing works. Adjust your .dimrc to match your
-setup and then run::
-
-    $ dim setup
-
-This will also check out the latest maintainer-tools branches, so please replace
-the dim you just downloaded with a symlink after this step. And by the way, if
-you have improvements for dim, please submit them to intel-gfx.
-
-You should now have a main repository for patch application. The directory
-corresponding to this repository is defined by DIM_DRM_INTEL in your .dimrc.
-You should also have directories called maintainer-tools, drm-tip (for
-rebuilding the tree), and drm-intel-rerere for some dim-internal book-keeping.
-
-If someone else has pushed patches first resync using::
-
-   $ dim update-branches
-
-Applying patches to dinq is done in the main repository with::
-
-    $ cat patch.mbox | dim apply-queued
-
-This works like a glorified version of git apply-mbox and does basic patch
-checking and adds stuff like patchwork links of the merged patch. It is
-preferred to use the patch email file instead of the original patch file since
-it contains some interesting headers like the message ID. When you're happy
-(remember that with a shared tree any mistake is permanent and there's no
-rebasing) push out the new tree with::
-
-    $ dim push-queued
-
-This will also rebuild a new drm-tip integration tree. If that fails, ask
-maintainers for help with resolving conflicts. One thing to note here is that
-the script syncs saved git rerere conflict resolutions around. One does the
-resolution, everyone has it. The drawback is, someone screws up the conflict
-resolution, everyone has it...
-
-Note that every two weeks Daniel cuts a new drm-intel-next by tagging what's in
-drm-intel-next-queued. To increase the chances that the tree isn't totally
-broken, only push bug fixes for serious problems on Thu/Fri (and weekend) every
-second week (at the moment the release cycle is aligned with odd work weeks, but
-just check out when the last tagged happened).
-
-If you need to push something to drm-intel-fixes or
-drm-intel-next-fixes, please quickly coordinate with Jani.
-
 CONTRIBUTING
 ============
 
-- 
2.11.0

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/6] dim: don't check everything in dim setup
  2017-01-26  9:10 [PATCH 1/6] dim: Update docs Daniel Vetter
@ 2017-01-26  9:10 ` Daniel Vetter
  2017-01-26  9:10 ` [PATCH 3/6] dim: Also allow git urls Daniel Vetter
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Daniel Vetter @ 2017-01-26  9:10 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

Laurent got mightily confused about this, and assumed he's getting
volunteered as an intel maintainer because dim asks for an intel
remote.

With the branch autodetection we can postpone all the remote checks to
when we need them. This is similar to the changes to update-branches
to only update branches that exist, but for remotes.

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

diff --git a/dim b/dim
index 5dfd0ef586be..e5afa9ee1bb8 100755
--- a/dim
+++ b/dim
@@ -1394,13 +1394,6 @@ function dim_setup
 		exit 1
 	fi
 
-	cd $DIM_DRM_INTEL
-
-	# check remote configuration
-	remote=`url_to_remote $linux_upstream_git`
-	remote=`url_to_remote $drm_intel_ssh`
-	remote=`url_to_remote $drm_upstream_git`
-
 	cd $DIM_PREFIX
 
 	setup_aux_checkout maintainer-tools $drm_intel_ssh maintainer-tools
-- 
2.11.0

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/6] dim: Also allow git urls
  2017-01-26  9:10 [PATCH 1/6] dim: Update docs Daniel Vetter
  2017-01-26  9:10 ` [PATCH 2/6] dim: don't check everything in dim setup Daniel Vetter
@ 2017-01-26  9:10 ` Daniel Vetter
  2017-01-26 10:39   ` Jani Nikula
  2017-01-26  9:10 ` [PATCH 4/6] dim: Add git_is_current_branch helper Daniel Vetter
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Daniel Vetter @ 2017-01-26  9:10 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

Maybe there's only a read-only remote available, and with the
drm-misc/-intel split that's perfectly fine.

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

diff --git a/dim b/dim
index e5afa9ee1bb8..cf61dc412652 100755
--- a/dim
+++ b/dim
@@ -218,11 +218,16 @@ function url_to_remote # url
 	remote=$(git remote -v | grep -m 1 "$url" | cut -f 1)
 
 	if [[ -z "$remote" ]]; then
-		echoerr "No git remote for url $url found in $(pwd)"
-		echoerr "Please set it up using:"
-		echoerr "    $ git remote add <name> $url"
-		echoerr "with a name of your choice."
-		return 1
+		git_url=`echo $url | sed -e 's/git\./anongit./' -e 's/ssh:/git:/'`
+		remote=$(git remote -v | grep -m 1 "$git_url" | cut -f 1)
+
+		if [[ -z "$remote" ]]; then
+			echoerr "No git remote for url $url or $git_url found in $(pwd)"
+			echoerr "Please set it up using:"
+			echoerr "    $ git remote add <name> $url"
+			echoerr "with a name of your choice."
+			return 1
+		fi
 	fi
 
 	echo $remote
-- 
2.11.0

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/6] dim: Add git_is_current_branch helper
  2017-01-26  9:10 [PATCH 1/6] dim: Update docs Daniel Vetter
  2017-01-26  9:10 ` [PATCH 2/6] dim: don't check everything in dim setup Daniel Vetter
  2017-01-26  9:10 ` [PATCH 3/6] dim: Also allow git urls Daniel Vetter
@ 2017-01-26  9:10 ` Daniel Vetter
  2017-01-26 10:43   ` Jani Nikula
  2017-01-26  9:10 ` [PATCH 5/6] dim: Add helper for checking for a branch Daniel Vetter
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Daniel Vetter @ 2017-01-26  9:10 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

And use it everywhere. Found a few more places that don't use the
usual style.

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

diff --git a/dim b/dim
index cf61dc412652..73fb32c4d5ab 100755
--- a/dim
+++ b/dim
@@ -302,6 +302,11 @@ function git_fetch_helper # remote
 	fi
 }
 
+function git_is_current_branch # branch
+{
+	git branch --list $1 | grep -q '\*'
+}
+
 if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then
         dim_uptodate
 fi
@@ -439,7 +444,7 @@ function dim_rebuild_tip
 	echo "Done."
 
 	cd $DIM_PREFIX/$integration_branch
-	if ! git branch --list $integration_branch | grep -q '\*' ; then
+	if ! git_is_current_branch $integration_branch ; then
 		echo "Branch setup for the integration repo is borked"
 		exit 1
 	fi
@@ -517,7 +522,7 @@ function dim_rebuild_tip
 
 	echo -n "Updating rerere cache... "
 	cd $rerere
-	if git branch --list rerere-cache | grep -q '\*' ; then
+	if git_is_current_branch rerere-cache ; then
 		remote=`branch_to_remote rerere-cache`
 
 		git pull >& /dev/null
@@ -1310,7 +1315,7 @@ function dim_update_branches
 	$DRY git reset --hard $DIM_DRM_INTEL_REMOTE/drm-intel-next
 
 	cd $DIM_PREFIX/maintainer-tools
-	if git branch | grep maintainer-tools | grep '\*' ; then
+	if git_is_current_branch maintainer-tools ; then
 		echo "Updating maintainer-tools ..."
 		git pull --rebase
 	fi
@@ -1425,7 +1430,7 @@ function assert_branch
 
 	dim_cd $branch
 
-	if git branch | grep $branch | grep '\*' ; then
+	if git_is_current_branch $branch ; then
 		return 0
 	else
 		echo "You're on the wrong branch, expected $branch in $PWD"
-- 
2.11.0

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/6] dim: Add helper for checking for a branch
  2017-01-26  9:10 [PATCH 1/6] dim: Update docs Daniel Vetter
                   ` (2 preceding siblings ...)
  2017-01-26  9:10 ` [PATCH 4/6] dim: Add git_is_current_branch helper Daniel Vetter
@ 2017-01-26  9:10 ` Daniel Vetter
  2017-01-26 10:46   ` Jani Nikula
  2017-01-26  9:10 ` [PATCH 6/6] dim: Don't try to create branches in update_branches Daniel Vetter
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Daniel Vetter @ 2017-01-26  9:10 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

And roll it out.

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

diff --git a/dim b/dim
index 73fb32c4d5ab..c5c46e9c767a 100755
--- a/dim
+++ b/dim
@@ -307,6 +307,15 @@ function git_is_current_branch # branch
 	git branch --list $1 | grep -q '\*'
 }
 
+function git_branch_exists # branch
+{
+	if [[ `git branch --list $1` == "" ]] ; then
+		false
+	else
+		true
+	fi
+}
+
 if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then
         dim_uptodate
 fi
@@ -825,7 +834,7 @@ function dim_remove_branch
 		git worktree prune &> /dev/null || true
 	fi
 
-	if [[ `git branch --list $branch`  != "" ]] &&
+	if git_branch_exists $branch &&
 	   ! $DRY git branch -d $branch  ; then
 			warn_or_fail "Can't remove $branch in working repo"
 	fi
@@ -876,7 +885,7 @@ function dim_checkout
 	branch=$1
 
 	dim_cd $branch
-	if [[ `git branch --list $branch` ==  "" ]] ; then
+	if ! git_branch_exists $branch ; then
 		repo=`branch_to_repo $branch`
 
 		if [[ $branch == "drm-intel-next" ]] ; then
@@ -1359,7 +1368,7 @@ function setup_aux_checkout # name url directory
 		if git help worktree &> /dev/null ; then
 			cd $DIM_PREFIX/$DIM_DRM_INTEL
 			remote=`url_to_remote $url`
-			if [[ `git branch --list $name` == "" ]] ; then
+			if ! git_branch_exists $name ; then
 				git_fetch_helper $remote
 				git branch --track $name $remote/$name
 			fi
@@ -1376,7 +1385,7 @@ function setup_aux_checkout # name url directory
 		cd $dir
 		remote=`url_to_remote $url`
 	fi
-	if [[ `git branch --list $name` == "" ]] ; then
+	if ! git_branch_exists $name ; then
 		git checkout -t $remote/$name
 	fi
 	cd - > /dev/null
-- 
2.11.0

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 6/6] dim: Don't try to create branches in update_branches
  2017-01-26  9:10 [PATCH 1/6] dim: Update docs Daniel Vetter
                   ` (3 preceding siblings ...)
  2017-01-26  9:10 ` [PATCH 5/6] dim: Add helper for checking for a branch Daniel Vetter
@ 2017-01-26  9:10 ` Daniel Vetter
  2017-01-26 10:47   ` Jani Nikula
  2017-01-26 10:42 ` [PATCH] dim: Explain how to resolve conflicts when git rerere fails Daniel Vetter
  2017-01-26 11:12 ` [PATCH 1/6] dim: Update docs Jani Nikula
  6 siblings, 1 reply; 12+ messages in thread
From: Daniel Vetter @ 2017-01-26  9:10 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

Avoids sprawnling branches everywhere, and makes the script faster for
folks who don't need everything. We already skip remotes, so this is
in line with what's there.

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

diff --git a/dim b/dim
index c5c46e9c767a..3991312ee310 100755
--- a/dim
+++ b/dim
@@ -1312,6 +1312,9 @@ function dim_update_branches
 	assert_repo_clean
 
 	for branch in $dim_branches ; do
+		if ! git_branch_exists $branch ; then
+			continue
+		fi
 		dim_checkout $branch
 		repo=`branch_to_repo $branch`
 		remote=`repo_to_remote $repo`
@@ -1320,8 +1323,10 @@ function dim_update_branches
 			$DRY git rebase -i
 		fi
 	done
-	dim_checkout drm-intel-next
-	$DRY git reset --hard $DIM_DRM_INTEL_REMOTE/drm-intel-next
+	if git_branch_exists drm-intel-next ; then
+		dim_checkout drm-intel-next
+		$DRY git reset --hard $DIM_DRM_INTEL_REMOTE/drm-intel-next
+	fi
 
 	cd $DIM_PREFIX/maintainer-tools
 	if git_is_current_branch maintainer-tools ; then
-- 
2.11.0

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/6] dim: Also allow git urls
  2017-01-26  9:10 ` [PATCH 3/6] dim: Also allow git urls Daniel Vetter
@ 2017-01-26 10:39   ` Jani Nikula
  0 siblings, 0 replies; 12+ messages in thread
From: Jani Nikula @ 2017-01-26 10:39 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

On Thu, 26 Jan 2017, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Maybe there's only a read-only remote available, and with the
> drm-misc/-intel split that's perfectly fine.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  dim | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/dim b/dim
> index e5afa9ee1bb8..cf61dc412652 100755
> --- a/dim
> +++ b/dim
> @@ -218,11 +218,16 @@ function url_to_remote # url
>  	remote=$(git remote -v | grep -m 1 "$url" | cut -f 1)
>  
>  	if [[ -z "$remote" ]]; then
> -		echoerr "No git remote for url $url found in $(pwd)"
> -		echoerr "Please set it up using:"
> -		echoerr "    $ git remote add <name> $url"
> -		echoerr "with a name of your choice."
> -		return 1
> +		git_url=`echo $url | sed -e 's/git\./anongit./' -e 's/ssh:/git:/'`

I've thought about fixing this in the past, and I'm sure you know the
above is far from being universally true. It may be a quick fix for fdo,
but quite the hack.

In fact, *all* drm-tip repos in nightly.conf could be written as git
urls, and we could rebuild drm-tip from them. There is no longer a need
to have any of them ssh:// urls.

BR,
Jani.


> +		remote=$(git remote -v | grep -m 1 "$git_url" | cut -f 1)
> +
> +		if [[ -z "$remote" ]]; then
> +			echoerr "No git remote for url $url or $git_url found in $(pwd)"
> +			echoerr "Please set it up using:"
> +			echoerr "    $ git remote add <name> $url"
> +			echoerr "with a name of your choice."
> +			return 1
> +		fi
>  	fi
>  
>  	echo $remote

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] dim: Explain how to resolve conflicts when git rerere fails
  2017-01-26  9:10 [PATCH 1/6] dim: Update docs Daniel Vetter
                   ` (4 preceding siblings ...)
  2017-01-26  9:10 ` [PATCH 6/6] dim: Don't try to create branches in update_branches Daniel Vetter
@ 2017-01-26 10:42 ` Daniel Vetter
  2017-01-26 11:12 ` [PATCH 1/6] dim: Update docs Jani Nikula
  6 siblings, 0 replies; 12+ messages in thread
From: Daniel Vetter @ 2017-01-26 10:42 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

Chris ran into this, and I guess worth documenting best practices
since it happens sooooooo rarely.

v2: Clarify stuff a bit.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drm-intel.rst | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/drm-intel.rst b/drm-intel.rst
index 79db1cf64bcb..b1ed6e02df0e 100644
--- a/drm-intel.rst
+++ b/drm-intel.rst
@@ -276,6 +276,39 @@ when it's tricky or something fails in the below procedure.
 
 And if any step fails or the conflict is tricky just ping maintainers.
 
+If the Conflict Reappears
+-------------------------
+
+In some odd cases git rerere fails to recognize the conflict, and doesn't apply
+the store conflict resolution. This needs to be handled with a manual fixup
+patch, and the best way to go about this:
+
+1. Try to resolve the conflict normally, but then running ::
+
+       $ dim rebuild-tip
+
+   fails. First, store the current state, including the conflict markers and
+   with no other changes applied::
+
+       $ cd $DIM_PREFIX/drm-tip
+       $ git add -u
+       $ git commmit
+
+2. Resolve the conflict normally, but don't stage it or commit it in any
+   fashion. Check that the resolution looks correct and removes all the conflict
+   markers you've just committed::
+
+       $ git diff
+
+   Then store it as a manual fixup patch::
+
+       $ git diff | dim cat-to-fixup
+
+   And finally rebuild the integration tree, which should now go through
+   smoothly, at least for this merge::
+
+       $ dim rebuild-tip
+
 Merge Timeline
 ==============
 
-- 
2.11.0

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/6] dim: Add git_is_current_branch helper
  2017-01-26  9:10 ` [PATCH 4/6] dim: Add git_is_current_branch helper Daniel Vetter
@ 2017-01-26 10:43   ` Jani Nikula
  0 siblings, 0 replies; 12+ messages in thread
From: Jani Nikula @ 2017-01-26 10:43 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

On Thu, 26 Jan 2017, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> And use it everywhere. Found a few more places that don't use the
> usual style.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  dim | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/dim b/dim
> index cf61dc412652..73fb32c4d5ab 100755
> --- a/dim
> +++ b/dim
> @@ -302,6 +302,11 @@ function git_fetch_helper # remote
>  	fi
>  }
>  
> +function git_is_current_branch # branch
> +{
> +	git branch --list $1 | grep -q '\*'

This could be made even stricter, but LGTM. And now further improvements
can be made in this function.

BR,
Jani.

> +}
> +
>  if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then
>          dim_uptodate
>  fi
> @@ -439,7 +444,7 @@ function dim_rebuild_tip
>  	echo "Done."
>  
>  	cd $DIM_PREFIX/$integration_branch
> -	if ! git branch --list $integration_branch | grep -q '\*' ; then
> +	if ! git_is_current_branch $integration_branch ; then
>  		echo "Branch setup for the integration repo is borked"
>  		exit 1
>  	fi
> @@ -517,7 +522,7 @@ function dim_rebuild_tip
>  
>  	echo -n "Updating rerere cache... "
>  	cd $rerere
> -	if git branch --list rerere-cache | grep -q '\*' ; then
> +	if git_is_current_branch rerere-cache ; then
>  		remote=`branch_to_remote rerere-cache`
>  
>  		git pull >& /dev/null
> @@ -1310,7 +1315,7 @@ function dim_update_branches
>  	$DRY git reset --hard $DIM_DRM_INTEL_REMOTE/drm-intel-next
>  
>  	cd $DIM_PREFIX/maintainer-tools
> -	if git branch | grep maintainer-tools | grep '\*' ; then
> +	if git_is_current_branch maintainer-tools ; then
>  		echo "Updating maintainer-tools ..."
>  		git pull --rebase
>  	fi
> @@ -1425,7 +1430,7 @@ function assert_branch
>  
>  	dim_cd $branch
>  
> -	if git branch | grep $branch | grep '\*' ; then
> +	if git_is_current_branch $branch ; then
>  		return 0
>  	else
>  		echo "You're on the wrong branch, expected $branch in $PWD"

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/6] dim: Add helper for checking for a branch
  2017-01-26  9:10 ` [PATCH 5/6] dim: Add helper for checking for a branch Daniel Vetter
@ 2017-01-26 10:46   ` Jani Nikula
  0 siblings, 0 replies; 12+ messages in thread
From: Jani Nikula @ 2017-01-26 10:46 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

On Thu, 26 Jan 2017, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> And roll it out.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Could probably look at the quoting a bit, but this is an
improvement. LGTM.

I've done some shellcheck(1) fixes in a dull moment in the past, I
should revive the series and post.

BR,
Jani.

> ---
>  dim | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/dim b/dim
> index 73fb32c4d5ab..c5c46e9c767a 100755
> --- a/dim
> +++ b/dim
> @@ -307,6 +307,15 @@ function git_is_current_branch # branch
>  	git branch --list $1 | grep -q '\*'
>  }
>  
> +function git_branch_exists # branch
> +{
> +	if [[ `git branch --list $1` == "" ]] ; then
> +		false
> +	else
> +		true
> +	fi
> +}
> +
>  if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then
>          dim_uptodate
>  fi
> @@ -825,7 +834,7 @@ function dim_remove_branch
>  		git worktree prune &> /dev/null || true
>  	fi
>  
> -	if [[ `git branch --list $branch`  != "" ]] &&
> +	if git_branch_exists $branch &&
>  	   ! $DRY git branch -d $branch  ; then
>  			warn_or_fail "Can't remove $branch in working repo"
>  	fi
> @@ -876,7 +885,7 @@ function dim_checkout
>  	branch=$1
>  
>  	dim_cd $branch
> -	if [[ `git branch --list $branch` ==  "" ]] ; then
> +	if ! git_branch_exists $branch ; then
>  		repo=`branch_to_repo $branch`
>  
>  		if [[ $branch == "drm-intel-next" ]] ; then
> @@ -1359,7 +1368,7 @@ function setup_aux_checkout # name url directory
>  		if git help worktree &> /dev/null ; then
>  			cd $DIM_PREFIX/$DIM_DRM_INTEL
>  			remote=`url_to_remote $url`
> -			if [[ `git branch --list $name` == "" ]] ; then
> +			if ! git_branch_exists $name ; then
>  				git_fetch_helper $remote
>  				git branch --track $name $remote/$name
>  			fi
> @@ -1376,7 +1385,7 @@ function setup_aux_checkout # name url directory
>  		cd $dir
>  		remote=`url_to_remote $url`
>  	fi
> -	if [[ `git branch --list $name` == "" ]] ; then
> +	if ! git_branch_exists $name ; then
>  		git checkout -t $remote/$name
>  	fi
>  	cd - > /dev/null

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 6/6] dim: Don't try to create branches in update_branches
  2017-01-26  9:10 ` [PATCH 6/6] dim: Don't try to create branches in update_branches Daniel Vetter
@ 2017-01-26 10:47   ` Jani Nikula
  0 siblings, 0 replies; 12+ messages in thread
From: Jani Nikula @ 2017-01-26 10:47 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

On Thu, 26 Jan 2017, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Avoids sprawnling branches everywhere, and makes the script faster for
> folks who don't need everything. We already skip remotes, so this is
> in line with what's there.

Seems okay. LGTM.

BR,
Jani.

>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  dim | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/dim b/dim
> index c5c46e9c767a..3991312ee310 100755
> --- a/dim
> +++ b/dim
> @@ -1312,6 +1312,9 @@ function dim_update_branches
>  	assert_repo_clean
>  
>  	for branch in $dim_branches ; do
> +		if ! git_branch_exists $branch ; then
> +			continue
> +		fi
>  		dim_checkout $branch
>  		repo=`branch_to_repo $branch`
>  		remote=`repo_to_remote $repo`
> @@ -1320,8 +1323,10 @@ function dim_update_branches
>  			$DRY git rebase -i
>  		fi
>  	done
> -	dim_checkout drm-intel-next
> -	$DRY git reset --hard $DIM_DRM_INTEL_REMOTE/drm-intel-next
> +	if git_branch_exists drm-intel-next ; then
> +		dim_checkout drm-intel-next
> +		$DRY git reset --hard $DIM_DRM_INTEL_REMOTE/drm-intel-next
> +	fi
>  
>  	cd $DIM_PREFIX/maintainer-tools
>  	if git_is_current_branch maintainer-tools ; then

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/6] dim: Update docs
  2017-01-26  9:10 [PATCH 1/6] dim: Update docs Daniel Vetter
                   ` (5 preceding siblings ...)
  2017-01-26 10:42 ` [PATCH] dim: Explain how to resolve conflicts when git rerere fails Daniel Vetter
@ 2017-01-26 11:12 ` Jani Nikula
  6 siblings, 0 replies; 12+ messages in thread
From: Jani Nikula @ 2017-01-26 11:12 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

On Thu, 26 Jan 2017, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> - Remove branch overview, instead link to drm-intel and drm-misc
>   pages.
>
> - Move quickstart to the top, to make it easier to find.
>
> - Make quickstart generic, we use dim for other stuff than drm-intel
>   now.
>
> - s/drm-intel-rerere/drm-rerere/
>
> - Remove the section about resolving conflicts, that's now explained
>   in detail in the process pages.
>
> v2: Also eradicate dinq (Laurent).
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Ack on this and the ones I didn't comment on separately.

> ---
>  dim.rst | 138 ++++++++++++++++++++++++----------------------------------------
>  1 file changed, 51 insertions(+), 87 deletions(-)
>
> diff --git a/dim.rst b/dim.rst
> index b9cb41a2ba5b..97b375e34e90 100644
> --- a/dim.rst
> +++ b/dim.rst
> @@ -23,40 +23,66 @@ DESCRIPTION
>  
>  drm-intel maintainer script.
>  
> -Branch Model
> -------------
> +Used to maintain drm-intel_ and drm-misc_ git repositories.
>  
> -The dim flow has 3 main development branches:
> +.. _drm-intel: drm-intel.html
> +.. _drm-misc: drm-misc.html
>  
> -- drm-intel-next-queued for feature work. This branch gets regularly pushed to
> -  drm-intel-next and tagged and then sent on to the upstream drm-next branch
> -  using *update-next*.  The cut-off for the last pull request to drm-next is
> -  around -rc5. After that point patches in drm-intel-next-queued already aim at
> -  the next but one and not the next merge window.
> +QUICKSTART
> +==========
>  
> -- drm-intel-next-fixes is to collect fixes for the current merge window after
> -  the -rc5 feature cut-off in drm-next.
> +For getting started grab the latest drm (drm-intel-maintainer) script from::
>  
> -- drm-intel-fixes is for fixes for the current -rc1 kernel. This is separate
> -  from drm-intel-next-fixes since the merge window feature cutoff at -rc5 is a
> -  few weeks ahead of the final release of the previous kernel.
> +    http://cgit.freedesktop.org/drm-intel/tree/dim?h=maintainer-tools
>  
> -  There's separate tracking branches for inclusion into linux-next to make sure
> -  that the feature work in drm-intel-next-queued aimed for the next but one
> -  merge window doesn't cause unecassary conflicts in linux-next - in that case
> -  only drm-intel-next-fixes is included in linux-next. The switchover happens
> -  when drm-intel-fixes has caught up (in git terms: drm-intel-next-fixes is
> -  direct ancestor of drm-intel-fixes). Therefore only roll drm-intel-fixes
> -  forward once -rc1 is released
> +There's also a sample config file for ~/.dimrc::
>  
> -In addition there's 2 permanent topic branches:
> +    http://cgit.freedesktop.org/drm-intel/tree/dimrc.sample?h=maintainer-tools
>  
> -- topic/drm-misc carries core drm patches aimed at the next merge window.
> +Plus, there's bash completion in the same directory if you feel like using that.
> +Run::
>  
> -- topic/drm-fixes carries core drm fixes for the current -rc kernels.
> +    $ dim help
>  
> -Additional topic branches are created as needed using *create-branch* and
> -*remove-branch*.
> +for tons of details about how this thing works. Also see the git repository
> +specific pages for details on the patch merging process for each tree. Adjust
> +your .dimrc to match your setup and then run::
> +
> +    $ dim setup
> +
> +This will also check out the latest maintainer-tools branches, so please replace
> +the dim you just downloaded with a symlink after this step. And by the way, if
> +you have improvements for dim, please submit them to intel-gfx.
> +
> +You should now have a main repository for patch application. The directory
> +corresponding to this repository is defined by DIM_DRM_INTEL in your .dimrc.
> +You should also have directories called maintainer-tools, drm-tip (for
> +rebuilding the tree), and drm-rerere for some dim-internal book-keeping.
> +
> +If someone else has pushed patches first resync using::
> +
> +   $ dim update-branches
> +
> +Since dim supports lots of different branches in different repositories you
> +first need to check out the right branch using::
> +
> +   $ dim checkout <branch>
> +
> +Applying patches is done in the main repository with::
> +
> +    $ cat patch.mbox | dim apply-branch <branch>
> +
> +This works like a glorified version of git apply-mbox and does basic patch
> +checking and adds stuff like patchwork links of the merged patch. It is
> +preferred to use the patch email file instead of the original patch file since
> +it contains some interesting headers like the message ID. When you're happy
> +(remember that with a shared tree any mistake is permanent and there's no
> +rebasing) push out the new tree with::
> +
> +    $ dim push-branch <branch>
> +
> +This will also rebuild a new drm-tip integration tree. For historical reasons
> +there's shortcut for the drm-intel specific branches for most of these commands.
>  
>  OPTIONS
>  =======
> @@ -375,68 +401,6 @@ DIM_TEMPLATE_SIGNATURE
>  ----------------------
>  Path to a file containing a signature template for pull request mails.
>  
> -QUICKSTART
> -==========
> -
> -For getting started grab the latest drm (drm-intel-maintainer) script from::
> -
> -    http://cgit.freedesktop.org/drm-intel/tree/dim?h=maintainer-tools
> -
> -There's also a sample config file for ~/.dimrc::
> -
> -    http://cgit.freedesktop.org/drm-intel/tree/dimrc.sample?h=maintainer-tools
> -
> -Plus, there's bash completion in the same directory if you feel like using that.
> -Run::
> -
> -    $ dim help
> -
> -for tons of details about how this thing works. Adjust your .dimrc to match your
> -setup and then run::
> -
> -    $ dim setup
> -
> -This will also check out the latest maintainer-tools branches, so please replace
> -the dim you just downloaded with a symlink after this step. And by the way, if
> -you have improvements for dim, please submit them to intel-gfx.
> -
> -You should now have a main repository for patch application. The directory
> -corresponding to this repository is defined by DIM_DRM_INTEL in your .dimrc.
> -You should also have directories called maintainer-tools, drm-tip (for
> -rebuilding the tree), and drm-intel-rerere for some dim-internal book-keeping.
> -
> -If someone else has pushed patches first resync using::
> -
> -   $ dim update-branches
> -
> -Applying patches to dinq is done in the main repository with::
> -
> -    $ cat patch.mbox | dim apply-queued
> -
> -This works like a glorified version of git apply-mbox and does basic patch
> -checking and adds stuff like patchwork links of the merged patch. It is
> -preferred to use the patch email file instead of the original patch file since
> -it contains some interesting headers like the message ID. When you're happy
> -(remember that with a shared tree any mistake is permanent and there's no
> -rebasing) push out the new tree with::
> -
> -    $ dim push-queued
> -
> -This will also rebuild a new drm-tip integration tree. If that fails, ask
> -maintainers for help with resolving conflicts. One thing to note here is that
> -the script syncs saved git rerere conflict resolutions around. One does the
> -resolution, everyone has it. The drawback is, someone screws up the conflict
> -resolution, everyone has it...
> -
> -Note that every two weeks Daniel cuts a new drm-intel-next by tagging what's in
> -drm-intel-next-queued. To increase the chances that the tree isn't totally
> -broken, only push bug fixes for serious problems on Thu/Fri (and weekend) every
> -second week (at the moment the release cycle is aligned with odd work weeks, but
> -just check out when the last tagged happened).
> -
> -If you need to push something to drm-intel-fixes or
> -drm-intel-next-fixes, please quickly coordinate with Jani.
> -
>  CONTRIBUTING
>  ============

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-01-26 11:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-26  9:10 [PATCH 1/6] dim: Update docs Daniel Vetter
2017-01-26  9:10 ` [PATCH 2/6] dim: don't check everything in dim setup Daniel Vetter
2017-01-26  9:10 ` [PATCH 3/6] dim: Also allow git urls Daniel Vetter
2017-01-26 10:39   ` Jani Nikula
2017-01-26  9:10 ` [PATCH 4/6] dim: Add git_is_current_branch helper Daniel Vetter
2017-01-26 10:43   ` Jani Nikula
2017-01-26  9:10 ` [PATCH 5/6] dim: Add helper for checking for a branch Daniel Vetter
2017-01-26 10:46   ` Jani Nikula
2017-01-26  9:10 ` [PATCH 6/6] dim: Don't try to create branches in update_branches Daniel Vetter
2017-01-26 10:47   ` Jani Nikula
2017-01-26 10:42 ` [PATCH] dim: Explain how to resolve conflicts when git rerere fails Daniel Vetter
2017-01-26 11:12 ` [PATCH 1/6] dim: Update docs Jani Nikula

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.