Hi all,
So here's all the bits I think we need for: - split out drm-misc.git repo - rolling model in drm-misc to avoid the merge window, like for drm-intel branches. - split out rerere stuff into a shared drm-tip.git repo - sharing .git metadata using git worktrees.
Conversion howto: 1. Update to latest dim, but store it somewhere outside of the maintainer-tools branch. 2. Remove the drm-intel-rerere, drm-intel-nightly and maintainter-tools branches. With the new dim .git repos can be shared (assuming your git has worktree support). 3. Run dim setup. I'll probably complain about a few missing remotes. Add them if needed - dim doesn't do this automatically to allow you to bikeshed the remote names ;-) 4. Profit!
If possible I'd like to roll this all out officially next week or so, so pls scream if you see any trouble.
Cheers, Daniel
Chris Wilson (1): dim-update-next: Update DRIVER_TIMESTAMP
Daniel Vetter (17): dim: Extract TODO dim: Autocheck for up-to-dateness dim: echoerr helper for printing to stderr dim: autodetect remotes, first part for dim_setup dim: support git worktree for aux checkouts dim: Nuke nightly-forget dim: autodetect branches in rebuild-nightly dim: remove integration-tree remotes dim: Split out drm-nightly.git dim: s/drm-nightly/drm-tip dim: use git branch --list dim: add revert-rerere dim: use get_maintainers.pl in dim fixes dim: support multiple remotes for branches dim: remove DIM_DRM_UPSTREAM_REMOTE config var dim: Adapat create/remove-branch dim: Make update_linux_next multi-repo compliant
TODO | 25 ++++ dim | 433 ++++++++++++++++++++++++++++++++--------------------- dim.rst | 37 +++-- dimrc.sample | 6 +- drm-intel-flow.dot | 18 +-- drm-intel.rst | 20 +-- qf | 11 -- 7 files changed, 333 insertions(+), 217 deletions(-) create mode 100644 TODO
Just maybe a bit more visibility, the scripts are growing.
Signed-off-by: Daniel Vetter daniel.vetter@intel.com --- TODO | 27 +++++++++++++++++++++++++++ dim | 17 ----------------- qf | 11 ----------- 3 files changed, 27 insertions(+), 28 deletions(-) create mode 100644 TODO
diff --git a/TODO b/TODO new file mode 100644 index 000000000000..ac0f27763dfa --- /dev/null +++ b/TODO @@ -0,0 +1,27 @@ +dim: +- extract the integration tree logic and make it generally useful, maybe for a + drm-integration tree ... +- Improve nightly-forget to forget a specific merge instead of just the first + dinq/dif merge. +- add option to check-patch to check stdin +- integrate ninja-check? Or too much checkers considered harmful? + https://lists.linuxfoundation.org/pipermail/ksummit-discuss/2014-May/000554.... +- add patchwork Link: also after manually resolving conflicts in drm + apply-resolved +- pull in dim extract-tags tool from Ville +- allow dim rebuild-nightly to pull branches from local trees in dry-run mode. + This is useful to confirm a backmerge is indeed correct, by comparing the + resulting -nightly with the old one. Current the branch must be pushed out + first for rebuild-nightly to pick it up, which means the merge can't be + fixed any more. + +qf: +- get better at preventing and cleaning up a mess when switching branches + while there's still applied quilt patches around ... +- combine quilt annotate and git blame into one tool +- use the index a bit more to e.g. stage all applied quilt patches, then use + the output of git diff to refresh a quilt patch +- use git commit-tree and git write-tree in the setup code instead of the + current high-level hacks +- track/restore the topmost patch maybe? +- synchronize quilt notes in qf push and qf fetch diff --git a/dim b/dim index 5fb3a0fee7ff..57ad4fcf9767 100755 --- a/dim +++ b/dim @@ -27,23 +27,6 @@
# drm-intel-next maintainer script
-# TODO -# - extract the integration tree logic and make it generally useful, maybe for a -# drm-integration tree ... -# - Improve nightly-forget to forget a specific merge instead of just the first -# dinq/dif merge. -# - add option to check-patch to check stdin -# - integrate ninja-check? Or too much checkers considered harmful? -# https://lists.linuxfoundation.org/pipermail/ksummit-discuss/2014-May/000554.... -# - add patchwork Link: also after manually resolving conflicts in drm -# apply-resolved -# - pull in dim extract-tags tool from Ville -# - allow dim rebuild-nightly to pull branches from local trees in dry-run mode. -# This is useful to confirm a backmerge is indeed correct, by comparing the -# resulting -nightly with the old one. Current the branch must be pushed out -# first for rebuild-nightly to pick it up, which means the merge can't be -# fixed any more. - # fail on any goof-up set -e
diff --git a/qf b/qf index 4e9cb03f31fe..31b9f3bae0a2 100755 --- a/qf +++ b/qf @@ -26,17 +26,6 @@
# quilt git flow script
-# TODO -# - get better at preventing and cleaning up a mess when switching branches -# while there's still applied quilt patches around ... -# - combine quilt annotate and git blame into one tool -# - use the index a bit more to e.g. stage all applied quilt patches, then use -# the output of git diff to refresh a quilt patch -# - use git commit-tree and git write-tree in the setup code instead of the -# current high-level hacks -# - track/restore the topmost patch maybe? -# - synchronize quilt notes in qf push and qf fetch - # config QUILT_PREFIX=quilt/
Exits script to annoy people roughly every 100th time ...
Also switch to the magic @{upstream} reference, in case the remote is not called origin (which is pretty normal in case of using git worktree).
Signed-off-by: Daniel Vetter daniel.vetter@intel.com --- dim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dim b/dim index 57ad4fcf9767..192d6ee10838 100755 --- a/dim +++ b/dim @@ -176,13 +176,17 @@ function dim_uptodate exit 1 fi
- if ! git --git-dir=$DIM_PREFIX/maintainer-tools/.git show origin/maintainer-tools:dim |\ + if ! git --git-dir=$DIM_PREFIX/maintainer-tools/.git show @{upstream}:dim |\ diff "$using" - >& /dev/null; then echo "$dim: not running upstream version of the script." >&2 exit 1 fi }
+if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then + dim_uptodate +fi + # get message id from file # $1 = file message_get_id ()
Signed-off-by: Daniel Vetter daniel.vetter@ffwll.ch --- dim | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/dim b/dim index 192d6ee10838..2601bb7dbbad 100755 --- a/dim +++ b/dim @@ -102,12 +102,17 @@ DRY= FORCE= HELP=
+function echoerr +{ + echo "$@" >&2 +} + function warn_or_fail { if [[ $FORCE ]] ; then - echo WARNING: $1, but continuing + echoerr WARNING: $1, but continuing else - echo ERROR: $1, aborting + echoerr ERROR: $1, aborting exit 1 fi } @@ -128,7 +133,7 @@ while getopts hdfi opt; do HELP=1 ;; *) - echo "See '$dim help' for more information." >&2 + echoerr "See '$dim help' for more information." exit esac done @@ -167,18 +172,18 @@ function dim_uptodate local using="${BASH_SOURCE[0]}"
if [[ ! -e "$using" ]]; then - echo "$dim: could not figure out the version being used ($using)." >&2 + echoerr "$dim: could not figure out the version being used ($using)." exit 1 fi
if [[ ! -e "$DIM_PREFIX/maintainer-tools/.git" ]]; then - echo "$dim: could not find the upstream repo for $dim." >&2 + echoerr "$dim: could not find the upstream repo for $dim." exit 1 fi
if ! git --git-dir=$DIM_PREFIX/maintainer-tools/.git show @{upstream}:dim |\ diff "$using" - >& /dev/null; then - echo "$dim: not running upstream version of the script." >&2 + echoerr "$dim: not running upstream version of the script." exit 1 fi } @@ -1280,6 +1285,6 @@ subcmd_func=dim_${subcmd//-/_} if declare -f $subcmd_func >/dev/null; then $subcmd_func "$@" else - echo "$dim: '$subcommand' is not a dim command." >&2 + echoerr "$dim: '$subcommand' is not a dim command." dim_usage fi
The goals here are multiple: - simpler configuration through autodetection - allows seamless upgrading to git worktree for the aux checkouts - eventually I want to split up drm-misc into a separate remote ...
And yes this is just a start.
v2: Print errors to stderr, otherwise they can't be seen when directly assigning the result of get_remote_name to a variable.
Signed-off-by: Daniel Vetter daniel.vetter@intel.com --- dim | 112 +++++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 58 insertions(+), 54 deletions(-)
diff --git a/dim b/dim index 2601bb7dbbad..90eb553c6575 100755 --- a/dim +++ b/dim @@ -192,6 +192,24 @@ if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then dim_uptodate fi
+function get_remote_name +{ + local remote_url=$1 + + local remote=`git remote -v | grep $remote_url | \ + head -n1 | sed -e 's/^(.*)\t.*/\1/'` + + if [[ $remote == "" ]] ; then + echoerr No git remote for $remote_url found in `pwd`. + echoerr Please set it up using + echoerr $ git remote add '<name>' $remote_url + echoerr with a name of your choice. + exit 1 + fi + + echo $remote +} + # get message id from file # $1 = file message_get_id () @@ -1044,8 +1062,36 @@ function dim_update_branches update_rerere_cache }
+function setup_aux_checkout # name remote +{ + local name=$1 + local remote_url=$2 + local dir=$3 + local remote + + echo "Setting up $dir ..." + + if [ ! -d $dir ]; then + git clone --reference=$DIM_PREFIX/$DIM_DRM_INTEL/.git $remote_url $dir + cd $dir + git config remote.origin.url $remote_url + echo "$DIM_PREFIX/$DIM_DRM_INTEL/.git/objects" > .git/objects/info/alternates + git repack -a -d -l + remote=origin + else + cd $dir + remote=`get_remote_name $drm_intel_ssh` + fi + if ! git branch | grep $name > /dev/null ; then + git checkout -t $remote/$name + fi + cd .. +} + function dim_setup { + local remote + if [ ! -d $DIM_PREFIX ]; then echo "please set up your repository directory with:" echo " mkdir -p $DIM_PREFIX" @@ -1062,76 +1108,34 @@ function dim_setup exit 1 fi cd $DIM_DRM_INTEL - if ! git remote -v | grep "^origin[[:space:]]" | grep $linux_upstream_git > /dev/null; then - echo "please set up remote origin for $linux_upstream_git" - exit 1 - fi - if ! git remote -v | grep "^$DIM_DRM_INTEL_REMOTE[[:space:]]" | grep $drm_intel_ssh > /dev/null; then - echo "please set up remote $DIM_DRM_INTEL_REMOTE for $drm_intel_ssh with:" - echo " git remote add $DIM_DRM_INTEL_REMOTE $drm_intel_ssh" - echo "or update your configuration." - exit 1 - fi - if ! git remote -v | grep "^$DIM_DRM_UPSTREAM_REMOTE[[:space:]]" | grep $drm_upstream_git > /dev/null; then - echo "please set up remote $DIM_DRM_UPSTREAM_REMOTE for $drm_upstream_git with:" - echo " git remote add $DIM_DRM_UPSTREAM_REMOTE $drm_upstream_git" - echo "or update your configuration." - exit 1 - fi - cd ..
- echo "Setting up maintainer-tools ..." - if [ ! -d maintainer-tools ]; then - git clone --reference=$DIM_PREFIX/$DIM_DRM_INTEL/.git $drm_intel_ssh maintainer-tools - fi - cd maintainer-tools - git config remote.origin.url $drm_intel_ssh - echo "$DIM_PREFIX/$DIM_DRM_INTEL/.git/objects" > .git/objects/info/alternates - git repack -a -d -l - if ! git branch | grep maintainer-tools > /dev/null ; then - git checkout -t origin/maintainer-tools - fi - cd .. + # check remote configuration + remote=`get_remote_name $linux_upstream_git` + remote=`get_remote_name $drm_intel_ssh` + remote=`get_remote_name $drm_upstream_git`
- echo "Setting up drm-intel-rerere ..." - if [ ! -d drm-intel-rerere ]; then - git clone --reference=$DIM_PREFIX/$DIM_DRM_INTEL/.git $drm_intel_ssh drm-intel-rerere - fi - cd drm-intel-rerere - git config remote.origin.url $drm_intel_ssh - echo "$DIM_PREFIX/$DIM_DRM_INTEL/.git/objects" > .git/objects/info/alternates - git repack -a -d -l - if ! git branch | grep rerere-cache > /dev/null ; then - git checkout -t origin/rerere-cache - fi cd ..
- echo "Setting up drm-intel-nightly ..." - if [ ! -d drm-intel-nightly ]; then - git clone --reference=$DIM_PREFIX/$DIM_DRM_INTEL/.git $drm_intel_ssh drm-intel-nightly - fi + setup_aux_checkout maintainer-tools $drm_intel_ssh maintainer-tools + + setup_aux_checkout rerere-cache $drm_intel_ssh drm-intel-rerere + + setup_aux_checkout drm-intel-nightly $drm_intel_ssh drm-intel-nightly cd drm-intel-nightly - mkdir -p .git/rr-cache - git config remote.origin.url $drm_intel_ssh - echo "$DIM_PREFIX/$DIM_DRM_INTEL/.git/objects" > .git/objects/info/alternates - git repack -a -d -l - if ! git branch | grep drm-intel-nightly > /dev/null ; then - git checkout -t origin/drm-intel-nightly - fi if git remote | grep drm-upstream > /dev/null ; then git config remote.drm-upstream.url $drm_upstream_git else - git remote add drm-upstream $drm_upstream_git + remote=`get_remote_name $drm_upstream_git` fi if git remote | grep sound-upstream > /dev/null ; then git config remote.sound-upstream.url $sound_upstream_git else - git remote add sound-upstream $sound_upstream_git + remote=`get_remote_name $sound_upstream_git` fi if git remote | grep driver-core-upstream > /dev/null ; then git config remote.driver-core-upstream.url $driver_core_upstream_git else - git remote add driver-core-upstream $driver_core_upstream_git + remote=`get_remote_name $driver_core_upstream_git` fi
echo "dim setup successfully completed!"
If available by default. This saves quite a pile of disk-space that imo making it the default is justified.
Note that this will break the rebuild-nightly script for now, follow-up patches will fix that.
Signed-off-by: Daniel Vetter daniel.vetter@intel.com --- dim | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/dim b/dim index 90eb553c6575..80baf24e4ad7 100755 --- a/dim +++ b/dim @@ -1072,15 +1072,24 @@ function setup_aux_checkout # name remote echo "Setting up $dir ..."
if [ ! -d $dir ]; then - git clone --reference=$DIM_PREFIX/$DIM_DRM_INTEL/.git $remote_url $dir - cd $dir - git config remote.origin.url $remote_url - echo "$DIM_PREFIX/$DIM_DRM_INTEL/.git/objects" > .git/objects/info/alternates - git repack -a -d -l - remote=origin + if git help worktree &> /dev/null ; then + cd $DIM_PREFIX/$DIM_DRM_INTEL + remote=`get_remote_name $remote_url` + if ! git branch | grep $name > /dev/null ; then + git branch --track $name $remote/$name + fi + git worktree add ../$dir $name + else + git clone --reference=$DIM_PREFIX/$DIM_DRM_INTEL/.git $remote_url $dir + cd $dir + git config remote.origin.url $remote_url + echo "$DIM_PREFIX/$DIM_DRM_INTEL/.git/objects" > .git/objects/info/alternates + git repack -a -d -l + remote=origin + fi else cd $dir - remote=`get_remote_name $drm_intel_ssh` + remote=`get_remote_name $remote_url` fi if ! git branch | grep $name > /dev/null ; then git checkout -t $remote/$name
With our proliferation of branches it's become long useless. Nowadays my MO is to revert the offending commit in the rerere-cache branch explicitly, remove drm-intel-nightly/.git/rr-cache and then re-run rebuild-nightly. That works much better, hence nuke this helper.
Signed-off-by: Daniel Vetter daniel.vetter@intel.com --- TODO | 2 -- dim | 9 --------- 2 files changed, 11 deletions(-)
diff --git a/TODO b/TODO index ac0f27763dfa..c1c6e20eb0e3 100644 --- a/TODO +++ b/TODO @@ -1,8 +1,6 @@ dim: - extract the integration tree logic and make it generally useful, maybe for a drm-integration tree ... -- Improve nightly-forget to forget a specific merge instead of just the first - dinq/dif merge. - add option to check-patch to check stdin - integrate ninja-check? Or too much checkers considered harmful? https://lists.linuxfoundation.org/pipermail/ksummit-discuss/2014-May/000554.... diff --git a/dim b/dim index 80baf24e4ad7..48d5e7b6477a 100755 --- a/dim +++ b/dim @@ -395,15 +395,6 @@ function dim_rebuild_nightly update_linux_next }
-function dim_nightly_forget -{ - cd $DIM_PREFIX/drm-intel-nightly - git fetch origin >& /dev/null - git reset --hard origin/drm-intel-next-queued >& /dev/null - git merge origin/drm-intel-fixes - git rerere forget -} - # push branch $1, rebuild nightly. the rest of the arguments are passed to git # push. function dim_push_branch
Needs new url-mapping information in nightly.conf to work properly.
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.
Signed-off-by: Daniel Vetter daniel.vetter@intel.com --- dim | 50 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 13 deletions(-)
diff --git a/dim b/dim index 48d5e7b6477a..adaffecf4015 100755 --- a/dim +++ b/dim @@ -197,7 +197,7 @@ function get_remote_name local remote_url=$1
local remote=`git remote -v | grep $remote_url | \ - head -n1 | sed -e 's/^(.*)\t.*/\1/'` + head -n1 | cut -f 1`
if [[ $remote == "" ]] ; then echoerr No git remote for $remote_url found in `pwd`. @@ -235,20 +235,30 @@ function dim_commit_add_tag done }
+function map_nightly_remote +{ + local nightly_remote=$1 + local remote_url=`eval echo "\$nightly_remote_url_${nightly_remote/-/_}"` + + get_remote_name $remote_url +} + function update_linux_next { cd $DIM_PREFIX/drm-intel-nightly
+ local nightly_origin=`map_nightly_remote origin` + # 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 $nightly_origin +$nightly_origin/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 $nightly_origin/drm-intel-next-fixes $nightly_origin/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 $nightly_origin +$nightly_origin/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 @@ -256,7 +266,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 $nightly_origin +$nightly_origin/drm-intel-next-fixes:for-linux-next >& /dev/null echo "Done." fi } @@ -272,11 +282,20 @@ function check_conflicts true }
+function rr_cache_dir +{ + if [ -d $DIM_PREFIX/drm-intel-nightly/.git/rr-cache/ ] ; then + echo $DIM_PREFIX/drm-intel-nightly/.git/rr-cache/ + else + echo $DIM_PREFIX/$DIM_DRM_INTEL/.git/rr-cache/ + fi +} + function update_rerere_cache { cd $DIM_PREFIX/drm-intel-rerere/ git pull - cp rr-cache/* $DIM_PREFIX/drm-intel-nightly/.git/rr-cache/ -r + cp rr-cache/* `rr_cache_dir` -r cd - }
@@ -307,9 +326,10 @@ function dim_rebuild_nightly fi
for remote in $(echo $nightly_branches | tr " " "\n" | sed 's|/.*$||g' | sort -u); do - echo -n "Fetching $remote... " + local nightly_remote=`map_nightly_remote $remote` + echo -n "Fetching $remote (as $nightly_remote) ... " # git fetch returns 128 if there's nothing to be fetched - git fetch $remote >& /dev/null || true + git fetch $nightly_remote >& /dev/null || true echo "Done." done
@@ -329,12 +349,14 @@ function dim_rebuild_nightly if [[ -n $sha1 ]] ; then echo -n "Using override sha1: $sha1... " else - sha1=$branch + local remote=${branch%%/*} + local nightly_remote=`map_nightly_remote $remote` + sha1=`echo $branch | sed -e s/^$remote/$nightly_remote/` 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 @@ -370,14 +392,16 @@ function dim_rebuild_nightly git commit --quiet -m "$integration_branch: $time integration manifest" echo "Done."
+ local nightly_origin=`map_nightly_remote origin` + echo -n "Pushing $integration_branch... " - git push $DRY_RUN origin +HEAD >& /dev/null && echo "Done." + git push $DRY_RUN $nightly_origin +HEAD >& /dev/null && echo "Done."
echo -n "Updating rerere cache... " cd $rerere if git branch | grep rerere-cache | grep '*' >& /dev/null ; then git pull >& /dev/null - cp $DIM_PREFIX/$integration_branch/.git/rr-cache/* rr-cache -r + cp `rr_cache_dir`/* rr-cache -r git add *.patch >& /dev/null || true git add rr-cache/* > /dev/null if git commit -m "$time: $integration_branch rerere cache update" >& /dev/null; then @@ -386,7 +410,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_origin HEAD >& /dev/null && echo "Done." else echo "Fail: Branch setup for the rerere-cache is borked." exit 1
With the remotes stored in nightly.conf and git worktrees we can avoid hard-coding them in even more places.
Signed-off-by: Daniel Vetter daniel.vetter@intel.com --- dim | 12 ------------ 1 file changed, 12 deletions(-)
diff --git a/dim b/dim index adaffecf4015..3792abe4d190 100755 --- a/dim +++ b/dim @@ -80,8 +80,6 @@ today=`date +%Y-%m-%d` drm_intel_ssh=ssh://git.freedesktop.org/git/drm-intel drm_intel_git=git://anongit.freedesktop.org/drm-intel drm_upstream_git=git://people.freedesktop.org/~airlied/linux -sound_upstream_git=git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git -driver_core_upstream_git=git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git linux_upstream_git=git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
# email aliases @@ -1151,16 +1149,6 @@ function dim_setup else remote=`get_remote_name $drm_upstream_git` fi - if git remote | grep sound-upstream > /dev/null ; then - git config remote.sound-upstream.url $sound_upstream_git - else - remote=`get_remote_name $sound_upstream_git` - fi - if git remote | grep driver-core-upstream > /dev/null ; then - git config remote.driver-core-upstream.url $driver_core_upstream_git - else - remote=`get_remote_name $driver_core_upstream_git` - fi
echo "dim setup successfully completed!" }
This is a prep step to eventually split out the drm-misc branches all into their own repo. To get there we first need to split out the integration tree mangling.
Since dim doesn't auto-update and since the transition is a good reason to switch over to worktrees and it's tricky it's not scripted. The following needs to be done when dim rebuild-nightly fails:
- Make sure you have the latest dim version.
- Good to also check you have a recent-ish git. Latest dim supports git worktree to save on disk space needed for .git metadata. It's much more robust than the git alternates storage trick we've used thus far. Note that git worktree is still optional (but that's not a recommended setup).
- Delete $DIM_PREFIX/{drm-intel-rerere,drm-intel-nightly,maintainer-tools} It's not strictly needed to kill the maintainer-tools checkout too, but might as well switch it over to git worktree too.
- Make sure you don't have any branches left over for drm-intel-rerere and drm-intel-nightly anywhere (since they need to switch their remotes).
- run dim setup and enjoy the new awesomeness.
If it breaks, I'm guilty ;-)
Signed-off-by: Daniel Vetter daniel.vetter@intel.com --- dim | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/dim b/dim index 3792abe4d190..85e5de92a13e 100755 --- a/dim +++ b/dim @@ -78,6 +78,7 @@ dim=$(basename $0) today=`date +%Y-%m-%d`
drm_intel_ssh=ssh://git.freedesktop.org/git/drm-intel +drm_nightly_ssh=ssh://git.freedesktop.org/git/drm-nightly drm_intel_git=git://anongit.freedesktop.org/drm-intel drm_upstream_git=git://people.freedesktop.org/~airlied/linux linux_upstream_git=git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git @@ -511,6 +512,8 @@ function dim_apply_next_fixes
function dim_cherry_pick { + local nightly_remote=`get_remote_name $drm_nightly_ssh` + if [[ "x$1" = "x" ]]; then echo "usage: $dim $subcommand commit-ish" exit 1 @@ -519,9 +522,9 @@ function dim_cherry_pick sha_short=${sha:0:8}
# need latest -nightly - git fetch $DIM_DRM_INTEL_REMOTE + git fetch $nightly_remote echo Possible fixup patches for your cherry-pick: - git log --grep=$sha_short --pretty=oneline $sha..$DIM_DRM_INTEL_REMOTE/drm-intel-nightly + git log --grep=$sha_short --pretty=oneline $sha..$nightly_remote/drm-intel-nightly $DRY git cherry-pick -s -x -e $1 }
@@ -890,15 +893,17 @@ function dim_for_each_workdirs
function dim_update_next { + local nightly_remote=`get_remote_name $drm_nightly_ssh` + assert_branch drm-intel-next-queued
git pull --ff-only
- if ! git branch --merged $DIM_DRM_INTEL_REMOTE/drm-intel-nightly | grep drm-intel-fixes &> /dev/null ; then + if ! git branch --merged $nightly_remote/drm-intel-nightly | grep drm-intel-fixes &> /dev/null ; then echo "drm-intel-fixes not merged into -nigthly, please update!" exit 2 fi - if ! git branch --merged $DIM_DRM_INTEL_REMOTE/drm-intel-nightly | grep drm-intel-next-queued &> /dev/null ; then + if ! git branch --merged $nightly_remote/drm-intel-nightly | grep drm-intel-next-queued &> /dev/null ; then echo "drm-intel-next-queued not merged into -nigthly, please update!" exit 2 fi @@ -920,6 +925,8 @@ function dim_update_next
function dim_update_next_continue { + local nightly_remote=`get_remote_name $drm_nightly_ssh` + assert_branch drm-intel-next-queued
git push $DRY_RUN -f $DIM_DRM_INTEL_REMOTE drm-intel-next-queued:drm-intel-next @@ -928,7 +935,7 @@ function dim_update_next_continue git push $DRY_RUN -f $DIM_DRM_INTEL_REMOTE $tag
echo "Updating -testing to latest -nightly" - git push $DRY_RUN $DIM_DRM_INTEL_REMOTE +$DIM_DRM_INTEL_REMOTE/drm-intel-nightly:drm-intel-testing + git push $DRY_RUN $DIM_DRM_INTEL_REMOTE +$nightly_remote/drm-intel-nightly:drm-intel-testing $DRY git tag -f drm-intel-testing-$today $DIM_DRM_INTEL_REMOTE/drm-intel-testing $DRY git push -f $DIM_DRM_INTEL_REMOTE drm-intel-testing-$today
@@ -1134,15 +1141,16 @@ function dim_setup # check remote configuration remote=`get_remote_name $linux_upstream_git` remote=`get_remote_name $drm_intel_ssh` + remote=`get_remote_name $drm_nightly_ssh` remote=`get_remote_name $drm_upstream_git`
cd ..
setup_aux_checkout maintainer-tools $drm_intel_ssh maintainer-tools
- setup_aux_checkout rerere-cache $drm_intel_ssh drm-intel-rerere + setup_aux_checkout rerere-cache $drm_nightly_ssh drm-intel-rerere
- setup_aux_checkout drm-intel-nightly $drm_intel_ssh drm-intel-nightly + setup_aux_checkout drm-intel-nightly $drm_nightly_ssh drm-intel-nightly cd drm-intel-nightly if git remote | grep drm-upstream > /dev/null ; then git config remote.drm-upstream.url $drm_upstream_git
tip = testing and integration pile
Also rename drm-intel-rerere directory to drm-rerere.
v2: don't call get_remote_name before switching directories.
Signed-off-by: Daniel Vetter daniel.vetter@intel.com --- dim | 52 ++++++++++++++++++++++++++-------------------------- dim.rst | 16 +++++++--------- dimrc.sample | 2 +- drm-intel-flow.dot | 18 +++++++++--------- drm-intel.rst | 20 +++++++++++--------- 5 files changed, 54 insertions(+), 54 deletions(-)
diff --git a/dim b/dim index 85e5de92a13e..5996306cddfb 100755 --- a/dim +++ b/dim @@ -78,7 +78,7 @@ dim=$(basename $0) today=`date +%Y-%m-%d`
drm_intel_ssh=ssh://git.freedesktop.org/git/drm-intel -drm_nightly_ssh=ssh://git.freedesktop.org/git/drm-nightly +drm_tip_ssh=ssh://git.freedesktop.org/git/drm-tip drm_intel_git=git://anongit.freedesktop.org/drm-intel drm_upstream_git=git://people.freedesktop.org/~airlied/linux linux_upstream_git=git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git @@ -151,7 +151,7 @@ fi #
if [ "$subcommand" != "setup" -a "$subcommand" != "help" -a "$subcommand" != "usage" ]; then - for d in $DIM_PREFIX $DIM_PREFIX/$DIM_DRM_INTEL $DIM_PREFIX/drm-intel-rerere $DIM_PREFIX/drm-intel-nightly; do + for d in $DIM_PREFIX $DIM_PREFIX/$DIM_DRM_INTEL $DIM_PREFIX/drm-rerere $DIM_PREFIX/drm-tip; do if [ ! -d $d ]; then echo "$d is missing, please check your configuration and/or run dim setup" exit 1 @@ -162,7 +162,7 @@ if [ "$subcommand" != "setup" -a "$subcommand" != "help" -a "$subcommand" != "us # Internal configuration that depends on a sane setup. #
- dim_branches=`(source $DIM_PREFIX/drm-intel-rerere/nightly.conf ; echo $nightly_branches) | \ + dim_branches=`(source $DIM_PREFIX/drm-rerere/nightly.conf ; echo $nightly_branches) | \ xargs -n 1 echo | grep '^origin' | sed -e 's/^origin///'` fi
@@ -244,7 +244,7 @@ function map_nightly_remote
function update_linux_next { - cd $DIM_PREFIX/drm-intel-nightly + cd $DIM_PREFIX/drm-tip
local nightly_origin=`map_nightly_remote origin`
@@ -283,8 +283,8 @@ function check_conflicts
function rr_cache_dir { - if [ -d $DIM_PREFIX/drm-intel-nightly/.git/rr-cache/ ] ; then - echo $DIM_PREFIX/drm-intel-nightly/.git/rr-cache/ + if [ -d $DIM_PREFIX/drm-tip/.git/rr-cache/ ] ; then + echo $DIM_PREFIX/drm-tip/.git/rr-cache/ else echo $DIM_PREFIX/$DIM_DRM_INTEL/.git/rr-cache/ fi @@ -292,7 +292,7 @@ function rr_cache_dir
function update_rerere_cache { - cd $DIM_PREFIX/drm-intel-rerere/ + cd $DIM_PREFIX/drm-rerere/ git pull cp rr-cache/* `rr_cache_dir` -r cd - @@ -300,12 +300,12 @@ function update_rerere_cache
function dim_rebuild_nightly { - local integration_branch=drm-intel-nightly + local integration_branch=drm-tip local specfile=`mktemp` local time="`date --utc +%Yy-%mm-%dd-%Hh-%Mm-%Ss` UTC" local first=1
- local rerere=$DIM_PREFIX/drm-intel-rerere + local rerere=$DIM_PREFIX/drm-rerere
cd $rerere if [[ `git status --porcelain | grep -v "^[ ?][ ?]" | wc -l` -gt 0 ]]; then @@ -512,7 +512,7 @@ function dim_apply_next_fixes
function dim_cherry_pick { - local nightly_remote=`get_remote_name $drm_nightly_ssh` + local nightly_remote=`get_remote_name $drm_tip_ssh`
if [[ "x$1" = "x" ]]; then echo "usage: $dim $subcommand commit-ish" @@ -524,7 +524,7 @@ function dim_cherry_pick # need latest -nightly git fetch $nightly_remote echo Possible fixup patches for your cherry-pick: - git log --grep=$sha_short --pretty=oneline $sha..$nightly_remote/drm-intel-nightly + git log --grep=$sha_short --pretty=oneline $sha..$nightly_remote/drm-tip $DRY git cherry-pick -s -x -e $1 }
@@ -649,7 +649,7 @@ function dim_create_branch
$DRY git branch $branch $start git push $DRY_RUN $DIM_DRM_INTEL_REMOTE +$branch --set-upstream - cd $DIM_PREFIX/drm-intel-rerere + cd $DIM_PREFIX/drm-rerere $DRY echo "nightly_branches="$nightly_branches origin/$branch"" \ >> nightly.conf $DRY git add nightly.conf @@ -674,10 +674,10 @@ function dim_remove_branch rm -R $DIM_PREFIX/$branch fi
- cd $DIM_PREFIX/drm-intel-nightly + cd $DIM_PREFIX/drm-tip git push $DRY_RUN origin --delete $branch $DRY git fetch origin --prune - cd $DIM_PREFIX/drm-intel-rerere + cd $DIM_PREFIX/drm-rerere full_branch="origin/$branch" $DRY sed -e "/${full_branch////\/}/d" -i nightly.conf $DRY git add nightly.conf @@ -893,17 +893,17 @@ function dim_for_each_workdirs
function dim_update_next { - local nightly_remote=`get_remote_name $drm_nightly_ssh` - assert_branch drm-intel-next-queued
+ local nightly_remote=`get_remote_name $drm_tip_ssh` + git pull --ff-only
- if ! git branch --merged $nightly_remote/drm-intel-nightly | grep drm-intel-fixes &> /dev/null ; then + if ! git branch --merged $nightly_remote/drm-tip | grep drm-intel-fixes &> /dev/null ; then echo "drm-intel-fixes not merged into -nigthly, please update!" exit 2 fi - if ! git branch --merged $nightly_remote/drm-intel-nightly | grep drm-intel-next-queued &> /dev/null ; then + if ! git branch --merged $nightly_remote/drm-tip | grep drm-intel-next-queued &> /dev/null ; then echo "drm-intel-next-queued not merged into -nigthly, please update!" exit 2 fi @@ -925,17 +925,17 @@ function dim_update_next
function dim_update_next_continue { - local nightly_remote=`get_remote_name $drm_nightly_ssh` - assert_branch drm-intel-next-queued
+ local nightly_remote=`get_remote_name $drm_tip_ssh` + git push $DRY_RUN -f $DIM_DRM_INTEL_REMOTE drm-intel-next-queued:drm-intel-next tag=drm-intel-next-$today $DRY git tag -f -a $tag $DIM_DRM_INTEL_REMOTE/drm-intel-next git push $DRY_RUN -f $DIM_DRM_INTEL_REMOTE $tag
echo "Updating -testing to latest -nightly" - git push $DRY_RUN $DIM_DRM_INTEL_REMOTE +$nightly_remote/drm-intel-nightly:drm-intel-testing + git push $DRY_RUN $DIM_DRM_INTEL_REMOTE +$nightly_remote/drm-tip:drm-intel-testing $DRY git tag -f drm-intel-testing-$today $DIM_DRM_INTEL_REMOTE/drm-intel-testing $DRY git push -f $DIM_DRM_INTEL_REMOTE drm-intel-testing-$today
@@ -1141,17 +1141,17 @@ function dim_setup # check remote configuration remote=`get_remote_name $linux_upstream_git` remote=`get_remote_name $drm_intel_ssh` - remote=`get_remote_name $drm_nightly_ssh` + remote=`get_remote_name $drm_tip_ssh` remote=`get_remote_name $drm_upstream_git`
cd ..
setup_aux_checkout maintainer-tools $drm_intel_ssh maintainer-tools
- setup_aux_checkout rerere-cache $drm_nightly_ssh drm-intel-rerere + setup_aux_checkout rerere-cache $drm_tip_ssh drm-rerere
- setup_aux_checkout drm-intel-nightly $drm_nightly_ssh drm-intel-nightly - cd drm-intel-nightly + setup_aux_checkout drm-tip $drm_tip_ssh drm-tip + cd drm-tip if git remote | grep drm-upstream > /dev/null ; then git config remote.drm-upstream.url $drm_upstream_git else @@ -1199,7 +1199,7 @@ function dim_list_aliases
function dim_cat_to_fixup { - cd $DIM_PREFIX/drm-intel-nightly + cd $DIM_PREFIX/drm-tip cat > `cat .fixup_file_path` }
diff --git a/dim.rst b/dim.rst index 85de95796611..dd4ba0fc5720 100644 --- a/dim.rst +++ b/dim.rst @@ -110,7 +110,7 @@ push-queued|pq [*git push arguments*] Updates the named branch, or drm-intel-fixes, drm-intel-next-fixes or the drm-intel-next-queued branch respectively. Complains if that's not the current branch, assuming that patches got merged to the wrong branch. After pushing also -updates linux-next and drm-intel-nightly branches. +updates linux-next and drm-tip branches.
checkout|co *branch* -------------------- @@ -189,10 +189,8 @@ CodingStyle approved format. cherry-pick *commit-ish* [*git cherry-pick arguments*] ------------------------------------------------------
-Improved git cherry-pick version which also scans drm-intel-nightly for any -mentions of the cherry-picked commit. Should be used when cherry-pick from -next -to -fixes to make sure all fixups are picked, too. In dry-run mode/-d only the -patch list is generated. +Improved git cherry-pick version which also scans drm-tip picked, too. In +dry-run mode/-d only the patch list is generated.
cherry-pick-fixes ----------------- @@ -399,7 +397,7 @@ 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-intel-nightly (for +You should also have directories called maintainer-tools, drm-tip (for rebuilding the tree), and drm-intel-rerere for some dim-internal book-keeping.
Applying patches to dinq is done in the main repository with:: @@ -415,9 +413,9 @@ rebasing) push out the new tree with::
$ dim push-queued
-This will also rebuild a new drm-intel-nightly 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 +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...
diff --git a/dimrc.sample b/dimrc.sample index ad463b42d537..42612a3a9fdf 100644 --- a/dimrc.sample +++ b/dimrc.sample @@ -4,7 +4,7 @@ # Defaults are in the comments below.
# Prefix for the repo directories. The prefix will contain -# $DIM_DRM_INTEL, drm-intel-nightly, maintainer-tools, etc. +# $DIM_DRM_INTEL, drm-tip, maintainer-tools, etc. #DIM_PREFIX=$HOME/linux
# Name of the main maintainer repo under $DIM_PREFIX. diff --git a/drm-intel-flow.dot b/drm-intel-flow.dot index 0c9879deba64..1be86164f5e0 100644 --- a/drm-intel-flow.dot +++ b/drm-intel-flow.dot @@ -56,7 +56,7 @@ strict digraph "drm-intel" { "drm-intel-next" [color=blue] "drm-intel-next-fixes" [color=blue] "drm-intel-next-queued" [label="drm-intel-next-queued\ntopic/* branches" color=blue] - "drm-intel-nightly" [color=blue] + "drm-tip" [color=blue] "drm-intel-testing" [color=blue] "drm-intel-internal" [color=blue]
@@ -66,20 +66,20 @@ strict digraph "drm-intel" { "drm-intel-next-fixes" -> "drm-next" [label="discretionary pulls\n~rc5..release" color=blue] "drm-intel-next-queued" -> "drm-intel-next" [color=blue] "drm-intel-next-queued" -> "drm-next" [label="special topic/* branches" color=blue] - "drm-intel-nightly" -> "drm-intel-testing" [label="snapshot for QA" color=blue] + "drm-tip" -> "drm-intel-testing" [label="snapshot for QA" color=blue]
# other trees in nightly "sound/for-linus" [color=yellow style=dashed] "sound/for-next" [color=yellow style=dashed]
# nightly rebuild - "drm-intel-fixes" -> "drm-intel-nightly" [label="rebuild" color=blue] - "drm-intel-next-fixes" -> "drm-intel-nightly" [label="rebuild" color=blue] - "drm-intel-next-queued" -> "drm-intel-nightly" [label="rebuild" color=blue] - "drm-next" -> "drm-intel-nightly" [label="rebuild" color=blue] - "drm-fixes" -> "drm-intel-nightly" [label="rebuild" color=blue] - "sound/for-next" -> "drm-intel-nightly" [label="rebuild" color=blue] - "sound/for-linus" -> "drm-intel-nightly" [label="rebuild" color=blue] + "drm-intel-fixes" -> "drm-tip" [label="rebuild" color=blue] + "drm-intel-next-fixes" -> "drm-tip" [label="rebuild" color=blue] + "drm-intel-next-queued" -> "drm-tip" [label="rebuild" color=blue] + "drm-next" -> "drm-tip" [label="rebuild" color=blue] + "drm-fixes" -> "drm-tip" [label="rebuild" color=blue] + "sound/for-next" -> "drm-tip" [label="rebuild" color=blue] + "sound/for-linus" -> "drm-tip" [label="rebuild" color=blue]
# patch flow "intel-gfx" [label="intel-gfx mailing list"] diff --git a/drm-intel.rst b/drm-intel.rst index 492cb580bbd5..e9cf240c4048 100644 --- a/drm-intel.rst +++ b/drm-intel.rst @@ -120,10 +120,12 @@ This is the fastest path to getting fixes to Linus' tree. It is generally for the regressions, cc:stable, black screens, GPU hangs only, and should pretty much follow the stable rules.
-drm-intel-nightly -~~~~~~~~~~~~~~~~~ +drm-tip +~~~~~~~
-This branch combines them all. Rebuilt every time one of the trees is pushed. +This branch combines them all. Rebuilt every time one of the trees is pushed. It +is living in a separate git repository name +`drm-tip https://cgit.freedesktop.org/drm-tip`_.
Patch and Merge Flow ==================== @@ -215,11 +217,11 @@ Signed-off-by: line in the commit message:
(cherry picked from commit 0bff4858653312a10c83709e0009c3adb87e6f1e)
-Resolving Conflicts when Rebuilding drm-intel-nightly -===================================================== +Resolving Conflicts when Rebuilding drm-tip +===========================================
-When you push patches with dim drm-intel-nightly always gets rebuild and this -can sometimes fail, for example like this: :: +When you push patches with dim drm-tip always gets rebuild and this can +sometimes fail, for example like this: ::
Updating rerere cache and nightly.conf... Done. Fetching drm-upstream... Done. @@ -246,9 +248,9 @@ when it's tricky or something fails in the below procedure. It's handy to keep the log output for context so that you know which branch caused the conflicts, and which branches are already included.
-3. Switch to $DIM_PREFIX/drm-intel-nightly and analyze the conflict: :: +3. Switch to $DIM_PREFIX/drm-tip and analyze the conflict: ::
- $ cd $DIM_PREFIX/drm-intel-nightly + $ cd $DIM_PREFIX/drm-tip $ git diff # shows three-way diff of conflict $ gitk --merge # lists all commits git believes to be relevant
... instead of git branch | grep. Handles submatches and branches starting with - reliably. Motivated by a review from Jani.
Cc: Jani Nikula jani.nikula@linux.intel.com Signed-off-by: Daniel Vetter daniel.vetter@intel.com --- dim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dim b/dim index 5996306cddfb..d01407a7b10c 100755 --- a/dim +++ b/dim @@ -319,7 +319,7 @@ function dim_rebuild_nightly source $rerere/nightly.conf
cd $DIM_PREFIX/$integration_branch - if ! git branch | grep $integration_branch | grep '*' >& /dev/null ; then + if ! git branch --list $integration_branch | grep '*' >& /dev/null ; then echo "Branch setup for the integration repo is borked" exit 1 fi @@ -398,7 +398,7 @@ function dim_rebuild_nightly
echo -n "Updating rerere cache... " cd $rerere - if git branch | grep rerere-cache | grep '*' >& /dev/null ; then + if git branch --list rerere-cache | grep '*' >& /dev/null ; then git pull >& /dev/null cp `rr_cache_dir`/* rr-cache -r git add *.patch >& /dev/null || true @@ -707,7 +707,7 @@ function dim_checkout fi
dim_cd $1 - if ! git branch | grep $1 > /dev/null ; then + if [[ `git branch --list $1` == "" ]] ; then git checkout -t $DIM_DRM_INTEL_REMOTE/$1 else git checkout $1 @@ -1095,7 +1095,7 @@ function setup_aux_checkout # name remote if git help worktree &> /dev/null ; then cd $DIM_PREFIX/$DIM_DRM_INTEL remote=`get_remote_name $remote_url` - if ! git branch | grep $name > /dev/null ; then + if [[ `git branch --list $name` == "" ]] ; then git branch --track $name $remote/$name fi git worktree add ../$dir $name @@ -1111,7 +1111,7 @@ function setup_aux_checkout # name remote cd $dir remote=`get_remote_name $remote_url` fi - if ! git branch | grep $name > /dev/null ; then + if [[ `git branch --list $name` == "" ]] ; then git checkout -t $remote/$name fi cd ..
Encodes the best practices for undoing a botched-up conflict resolution.
Signed-off-by: Daniel Vetter daniel.vetter@intel.com --- dim | 7 +++++++ dim.rst | 12 +++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/dim b/dim index d01407a7b10c..91aa99f230e7 100755 --- a/dim +++ b/dim @@ -298,6 +298,13 @@ function update_rerere_cache cd - }
+function dim_revert_rerere +{ + cd $DIM_PREFIX/drm-rerere/ + git revert $1 + rm `rr_cache_dir`/* -Rf +} + function dim_rebuild_nightly { local integration_branch=drm-tip diff --git a/dim.rst b/dim.rst index dd4ba0fc5720..ca9670ebc1b5 100644 --- a/dim.rst +++ b/dim.rst @@ -9,7 +9,7 @@ drm-intel maintainer script :Author: Daniel Vetter daniel.vetter@ffwll.ch :Author: Jani Nikula jani.nikula@intel.com :Date: 2014-05-15 -:Copyright: 2012-2015 Intel Corporation +:Copyright: 2012-2016 Intel Corporation :Manual section: 1 :Manual group: maintainer tools
@@ -90,6 +90,16 @@ rebuild-nightly Rebuilds the nightly branch. Useful when ad-hoc trees are included in -nightly.
+revert-rerere *rerere-chache-commit-ish* +---------------------------------------- + +When a stored conflict resolution in the integration tree 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-nightly* to redo the +merges, correctly. + cat-to-fixup ------------
For even more Cc! Result is sometimes a bit excessive and will need some trimming sometimes.
v2: Don't sort, since that makes a mess of the list.
Signed-off-by: Daniel Vetter daniel.vetter@ffwll.ch --- dim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dim b/dim index 91aa99f230e7..8120d159cea8 100755 --- a/dim +++ b/dim @@ -1242,10 +1242,12 @@ function dim_fixes
echo "Fixes: $(dim_cite $sha1)"
+ ( git show --no-patch $sha1 | \ sed -e 's/(Reviewed|Acked|Reported|Signed)[a-zA-Z-]*-by:/Cc:/' | \ - sed -e 's/^ C[Cc]: */Cc: /' | grep '^Cc: ' | \ - sort | uniq + sed -e 's/^ C[Cc]: */Cc: /' | grep '^Cc: ' + git show $sha1 | scripts/get_maintainer.pl --email --norolestats | sed -e "s/^/Cc: /" + ) | awk '!x[$0]++'
local tag=$(git tag --contains $1 | grep ^v | sort -V | head -n 1) if [[ -n "$tag" ]]; then
From: Chris Wilson chris@chris-wilson.co.uk
Along with the DRIVER_DATE, also update the DRIVER_TIMESTAMP as measured in seconds from the start of the epoch.
Signed-off-by: Chris Wilson chris@chris-wilson.co.uk Cc: Daniel Vetter daniel@ffwll.ch Signed-off-by: Daniel Vetter daniel.vetter@ffwll.ch --- dim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dim b/dim index 8120d159cea8..4d5008ecce11 100755 --- a/dim +++ b/dim @@ -916,7 +916,8 @@ function dim_update_next fi
driver_date=`date +%Y%m%d` - $DRY sed -i -e "s/^#define DRIVER_DATE.*"[0-9]*"$/#define DRIVER_DATE\t\t"$driver_date"/" \ + driver_timestamp=`date +%s` + $DRY sed -i -e "s/^#define DRIVER_DATE.*"[0-9]*"$/#define DRIVER_DATE\t\t"$driver_date"/; s/^#define DRIVER_TIMESTAMP.*/#define DRIVER_TIMESTAMP\t$driver_timestamp/" \ drivers/gpu/drm/i915/i915_drv.h $DRY git add drivers/gpu/drm/i915/i915_drv.h echo -e "drm/i915: Update DRIVER_DATE to $driver_date\n\nSigned-off-by: Daniel Vetter daniel.vetter@ffwll.ch" | \
Still left to do is fixing up create-branch and remove-branch. Everything else should work here now.
Signed-off-by: Daniel Vetter daniel.vetter@intel.com --- dim | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-)
diff --git a/dim b/dim index 4d5008ecce11..fc99108b6e55 100755 --- a/dim +++ b/dim @@ -163,7 +163,8 @@ if [ "$subcommand" != "setup" -a "$subcommand" != "help" -a "$subcommand" != "us #
dim_branches=`(source $DIM_PREFIX/drm-rerere/nightly.conf ; echo $nightly_branches) | \ - xargs -n 1 echo | grep '^origin' | sed -e 's/^origin///'` + xargs -n 1 echo | grep '^(drm-intel|drm-misc)' | \ + sed -e 's/^(drm-intel|drm-misc)///'` fi
function dim_uptodate @@ -209,6 +210,14 @@ function get_remote_name echo $remote }
+function get_remote_for_branch +{ + local remote=`git rev-parse --abbrev-ref --symbolic-full-name $1@{upstream}` + remote=${remote%%/*} + + echo $remote +} + # get message id from file # $1 = file message_get_id () @@ -434,12 +443,14 @@ function dim_push_branch exit 1 fi
- branch=$1 + local branch=$1 shift
assert_branch $branch
- git push $DRY_RUN $DIM_DRM_INTEL_REMOTE $branch "$@" + local remote=`get_remote_for_branch $branch` + + git push $DRY_RUN $remote $branch "$@"
dim_rebuild_nightly } @@ -715,7 +726,11 @@ function dim_checkout
dim_cd $1 if [[ `git branch --list $1` == "" ]] ; then - git checkout -t $DIM_DRM_INTEL_REMOTE/$1 + if [[ `git branch --list --remote $1` == "" ]] ; then + git checkout -t $DIM_DRM_INTEL_REMOTE/$1 + else + git checkout -t $1 + fi else git checkout $1 fi @@ -999,8 +1014,9 @@ function dim_pull_request exit 1 fi
- branch=$1 - upstream=$2 + local branch=$1 + local upstream=$2 + local remote=`get_remote_for_branch $1`
if [ "$branch" != "drm-intel-next" ]; then assert_branch $branch @@ -1013,13 +1029,13 @@ function dim_pull_request
if [ "$branch" = "drm-intel-next" ]; then # drm-intel-next pulls have been tagged using dim update-next - drm_intel_next_tags=`git log $DIM_DRM_INTEL_REMOTE/drm-intel-next ^$upstream --decorate | grep "(.*tag: drm-intel-next-" | sed -e "s/^.*(.*tag: (drm-intel-next-[^ ,]*).*)$/\1/"` + drm_intel_next_tags=`git log $branch@{upstream} ^$upstream --decorate | grep "(.*tag: drm-intel-next-" | sed -e "s/^.*(.*tag: (drm-intel-next-[^ ,]*).*)$/\1/"` prep_pull_mail $drm_intel_next_tags - tag=`git describe --all --exact $DIM_DRM_INTEL_REMOTE/drm-intel-next` + tag=`git describe --all --exact $branch@{upstream}` else tag=$branch-$today - $DRY git tag -f $tag $DIM_DRM_INTEL_REMOTE/$branch - $DRY git push -f $DIM_DRM_INTEL_REMOTE $tag + $DRY git tag -f $tag $branch@{upstream} + $DRY git push -f $remote $tag prep_pull_mail fi
With the automatic remote lookup this is no longer needed. That means moving get_remote_name a bit, and I'm too lazy to rebase that out.
v2: Wrap strings in "" (Jani).
Signed-off-by: Daniel Vetter daniel.vetter@intel.com --- dim | 56 +++++++++++++++++++++++++++----------------------------- dim.rst | 4 ---- dimrc.sample | 4 ---- 3 files changed, 27 insertions(+), 37 deletions(-)
diff --git a/dim b/dim index fc99108b6e55..1ab86d5a4ee9 100755 --- a/dim +++ b/dim @@ -50,9 +50,6 @@ DIM_DRM_INTEL=${DIM_DRM_INTEL:-src} # name of the $drm_intel_ssh remote within $DIM_DRM_INTEL DIM_DRM_INTEL_REMOTE=${DIM_DRM_INTEL_REMOTE:-danvet}
-# name of the $drm_upstream_git remote within $DIM_DRM_INTEL -DIM_DRM_UPSTREAM_REMOTE=${DIM_DRM_UPSTREAM_REMOTE:-airlied} - # mail user agent. must support a subset of mutt(1) command line options: # usage: $DIM_MUA [-s subject] [-i file] [-c cc-addr] to-addr [...] DIM_MUA=${DIM_MUA:-mutt} @@ -150,6 +147,24 @@ fi # Sanity checks. #
+function get_remote_name +{ + local remote_url=$1 + + local remote=`git remote -v | grep $remote_url | \ + head -n1 | cut -f 1` + + if [[ $remote == "" ]] ; then + echoerr "No git remote for $remote_url found in `pwd`." + echoerr "Please set it up using" + echoerr " $ git remote add '<name>' $remote_url" + echoerr "with a name of your choice." + exit 1 + fi + + echo $remote +} + if [ "$subcommand" != "setup" -a "$subcommand" != "help" -a "$subcommand" != "usage" ]; then for d in $DIM_PREFIX $DIM_PREFIX/$DIM_DRM_INTEL $DIM_PREFIX/drm-rerere $DIM_PREFIX/drm-tip; do if [ ! -d $d ]; then @@ -165,6 +180,7 @@ if [ "$subcommand" != "setup" -a "$subcommand" != "help" -a "$subcommand" != "us dim_branches=`(source $DIM_PREFIX/drm-rerere/nightly.conf ; echo $nightly_branches) | \ xargs -n 1 echo | grep '^(drm-intel|drm-misc)' | \ sed -e 's/^(drm-intel|drm-misc)///'` + dim_drm_uptream_remote=`cd $DIM_PREFIX/$DIM_DRM_INTEL; get_remote_name $drm_upstream_git` fi
function dim_uptodate @@ -192,24 +208,6 @@ if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then dim_uptodate fi
-function get_remote_name -{ - local remote_url=$1 - - local remote=`git remote -v | grep $remote_url | \ - head -n1 | cut -f 1` - - if [[ $remote == "" ]] ; then - echoerr No git remote for $remote_url found in `pwd`. - echoerr Please set it up using - echoerr $ git remote add '<name>' $remote_url - echoerr with a name of your choice. - exit 1 - fi - - echo $remote -} - function get_remote_for_branch { local remote=`git rev-parse --abbrev-ref --symbolic-full-name $1@{upstream}` @@ -938,7 +936,7 @@ function dim_update_next echo -e "drm/i915: Update DRIVER_DATE to $driver_date\n\nSigned-off-by: Daniel Vetter daniel.vetter@ffwll.ch" | \ git commit -s -F -
- gitk drm-intel-next-queued ^$DIM_DRM_UPSTREAM_REMOTE/drm-next & + gitk drm-intel-next-queued ^$dim_drm_uptream_remote/drm-next &
# try to push dinq first in case someone raced dim push-queued @@ -1051,7 +1049,7 @@ function dim_pull_request
function dim_pull_request_next { - upstream=${1:-$DIM_DRM_UPSTREAM_REMOTE/drm-next} + upstream=${1:-$dim_drm_uptream_remote/drm-next} dim_pull_request drm-intel-next $upstream }
@@ -1063,7 +1061,7 @@ function dim_pull_request_fixes
function dim_pull_request_next_fixes { - upstream=${1:-$DIM_DRM_UPSTREAM_REMOTE/drm-next} + upstream=${1:-$dim_drm_uptream_remote/drm-next} dim_pull_request drm-intel-next-fixes $upstream }
@@ -1071,8 +1069,8 @@ function dim_pull_request_next_fixes function dim_list_upstreams { echo origin/master - echo $DIM_DRM_UPSTREAM_REMOTE/drm-next - echo $DIM_DRM_UPSTREAM_REMOTE/drm-fixes + echo $dim_drm_uptream_remote/drm-next + echo $dim_drm_uptream_remote/drm-fixes }
# Note: used by bash completion @@ -1085,7 +1083,7 @@ dim_alias_ub=update-branches function dim_update_branches { cd $DIM_PREFIX/$DIM_DRM_INTEL - for remote in $DIM_DRM_INTEL_REMOTE $DIM_DRM_UPSTREAM_REMOTE origin; do + for remote in $DIM_DRM_INTEL_REMOTE $dim_drm_uptream_remote origin; do git fetch $remote done
@@ -1237,8 +1235,8 @@ function dim_tc # not in a tagged release, show upstream branches git branch -r --contains $1 \ $DIM_DRM_INTEL_REMOTE/* \ - $DIM_DRM_UPSTREAM_REMOTE/drm-next \ - $DIM_DRM_UPSTREAM_REMOTE/drm-fixes \ + $dim_drm_uptream_remote/drm-next \ + $dim_drm_uptream_remote/drm-fixes \ origin/master | sed 's/^ *//' fi } diff --git a/dim.rst b/dim.rst index ca9670ebc1b5..171c71bfdb6d 100644 --- a/dim.rst +++ b/dim.rst @@ -359,10 +359,6 @@ DIM_DRM_INTEL_REMOTE -------------------- Name of the $drm_intel_ssh remote within $DIM_DRM_INTEL.
-DIM_DRM_UPSTREAM_REMOTE ------------------------ -Name of the $drm_upstream_git remote within $DIM_DRM_INTEL. - DIM_MUA ------- Mail user agent. Must support the following subset of **mutt(1)** command line diff --git a/dimrc.sample b/dimrc.sample index 42612a3a9fdf..be7b99cb6b76 100644 --- a/dimrc.sample +++ b/dimrc.sample @@ -14,10 +14,6 @@ # $DIM_DRM_INTEL #DIM_DRM_INTEL_REMOTE=danvet
-# Name of the remote for git://people.freedesktop.org/~airlied/linux -# within $DIM_DRM_INTEL -#DIM_DRM_UPSTREAM_REMOTE=airlied - # Mail User Agent supporting a subset of mutt(1) command line options: # [-s subject] [-i file] [-c cc-addr] to-addr [...] #DIM_MUA=mutt
Looking up the remote for deleting the branch is a bit an exercise.
v2: Correctly keep the fake remote name from nightly.conf and the real (local) remote name apart.
Signed-off-by: Daniel Vetter daniel.vetter@intel.com --- dim | 54 +++++++++++++++++++++++++++++++++++++++++++++--------- dim.rst | 5 ++++- 2 files changed, 49 insertions(+), 10 deletions(-)
diff --git a/dim b/dim index 1ab86d5a4ee9..f42b1eebf48b 100755 --- a/dim +++ b/dim @@ -654,7 +654,9 @@ function dim_create_branch echo "usage: $dim $subcommand branch [commit-ish]" exit 1 fi - branch=$1 + local branch=$1 + local nightly_remote="drm-intel" + if [[ "x$2" = "x" ]]; then start=HEAD else @@ -663,10 +665,19 @@ function dim_create_branch
cd $DIM_PREFIX/$DIM_DRM_INTEL
+ source $DIM_PREFIX/drm-rerere/nightly.conf + + if ( map_nightly_remote ${branch%%/*} ) &> /dev/null ; then + nightly_remote=${branch%%/*} + branch=${branch#*/} + fi + + local remote=`map_nightly_remote $nightly_remote` + $DRY git branch $branch $start - git push $DRY_RUN $DIM_DRM_INTEL_REMOTE +$branch --set-upstream + git push $DRY_RUN $remote +$branch --set-upstream cd $DIM_PREFIX/drm-rerere - $DRY echo "nightly_branches="$nightly_branches origin/$branch"" \ + $DRY echo "nightly_branches="$nightly_branches $nightly_remote/$branch"" \ >> nightly.conf $DRY git add nightly.conf $DRY git commit --quiet -m "Adding $branch to -nightly" @@ -678,23 +689,48 @@ function dim_remove_branch echo "usage: $dim $subcommand branch" exit 1 fi - branch=$1 + local branch=$1
cd $DIM_PREFIX/$DIM_DRM_INTEL
- if ! $DRY git branch -d $branch ; then - warn_or_fail "Can't remove $branch in working repo" + if [[ `git branch --list $branch` != "" ]] && + ! $DRY git branch -d $branch ; then + warn_or_fail "Can't remove $branch in working repo" fi
if [[ -d $DIM_PREFIX/$branch ]] ; then rm -R $DIM_PREFIX/$branch + git worktree prune &> /dev/null || true fi
cd $DIM_PREFIX/drm-tip - git push $DRY_RUN origin --delete $branch - $DRY git fetch origin --prune + + 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 + + if [[ $nightly_remote == "" ]] ; then + echoerr "$branch not found in nightly.conf" + exit 1 + fi + + local remote=`map_nightly_remote $nightly_remote` + + git push $DRY_RUN $remote --delete $branch + $DRY git fetch $remote --prune cd $DIM_PREFIX/drm-rerere - full_branch="origin/$branch" + full_branch="$nightly_remote/$branch" $DRY sed -e "/${full_branch////\/}/d" -i nightly.conf $DRY git add nightly.conf $DRY git commit --quiet -m "Deleted $branch and removed from -nightly" diff --git a/dim.rst b/dim.rst index 171c71bfdb6d..886d94f9231c 100644 --- a/dim.rst +++ b/dim.rst @@ -283,7 +283,10 @@ create-branch *branch* [*commit-ish*] -------------------------------------
Create a new topic branch with the given name. Note that topic/ is not -automatically prepended. The branch starts at HEAD or the given commit-ish. +automatically prepended. The branch starts at HEAD or the given commit-ish. Note +that by default the new branch is created in the drm-intel.git repository. If +you want to create a branch somewhere else, then you need to prepend the remote +name from nigthly.conf, e.g. "drm-misc/topic/branch".
remove-branch *branch* ----------------------
- 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"
dri-devel@lists.freedesktop.org