dim: Extract TODO
PATCH 1/10 dim: Extract TODO
Just maybe a bit more visibility, the scripts are growing.
--- TODO | 27 +++++++++++++++++++++++++++ dim | 17 ----------------- qf | 11 ----------- 3 files changed, 27 insertions(+), 28 deletions(-) create mode 100644 TODO
TODO new file +27 -0
@@ -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.html +- 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
dim +0 -17
@@ -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.html -# - 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
qf +0 -11
@@ -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/
Signature · 6 lines
2.9.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/10 dim: Autocheck for up-to-dateness
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).
--- dim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
dim +5 -1
@@ -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 ()
Signature · 6 lines
2.9.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 02/10] dim: Autocheck for up-to-dateness
Quoted 1 line · Daniel Vetter
Exits script to annoy people roughly every 100th time ...
Annoyingly random, but we can improve this later.
LGTM.
Quoted 32 lines
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 <[email protected]>--- dim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)dim +5
-1@@ -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 ()
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 02/10] dim: Autocheck for up-to-dateness
Quoted 4 lines · Jani Nikula
Quoted 1 line · Daniel Vetter
Exits script to annoy people roughly every 100th time ...
Annoyingly random, but we can improve this later.
I had it non-random, then realized it makes improving dim impossible ;-) -Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 02/10] dim: Autocheck for up-to-dateness
Quoted 7 lines · Daniel Vetter
Quoted 4 lines · Jani Nikula
Quoted 1 line · Daniel Vetter
Exits script to annoy people roughly every 100th time ...
Annoyingly random, but we can improve this later.
I had it non-random, then realized it makes improving dim impossible ;-)
I thought about just warning on every Nth day $((date +%j % N)) == 0, and not exiting the script. Warning every time is annoying because it talks to the network.
BR,
Jani.
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/10 dim: echoerr helper for printing to stderr
In reply to Daniel Vetter--- dim | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
dim +12 -7
@@ -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
Signature · 6 lines
2.9.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 03/10] dim: echoerr helper for printing to stderr
Quoted 10 lines · Daniel Vetter
Signed-off-by Daniel Vetter <[email protected]>--- dim | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)dim +0
-0
dim DRY= · line 108
Quoted 7 lines
dim +4
-0@@ -102,12 +102,17 @@ DRY= FORCE= HELP= +function echoerr +{ + echo "$@" >&2 +}
I guess you could move the "$dim: " prefix here, to ensure all places will have that. Can be a follow-up.
BR,
Jani.
Quoted 51 lines
dim +8
-7+ 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
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 4/10 dim: autodetect remotes, first part for dim_setup
In reply to Daniel VetterThe 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.
--- dim | 112 +++++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 58 insertions(+), 54 deletions(-)
dim +58 -54
@@ -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!"
Signature · 6 lines
2.9.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [PATCH 04/10] dim: autodetect remotes, first part for dim_setup
Quoted 20 lines · Daniel Vetter
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_nameto a variable.Signed-off-by Daniel Vetter <[email protected]>--- dim | 112 +++++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 58 insertions(+), 54 deletions(-)dim +0
-0
dim if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then · line 200
Quoted 9 lines
dim +6
-0@@ -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/'`
'cut -f 1' seems cleaner than the sed.
dim if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then · line 202
Quoted 2 lines
dim +2
-0+ + if [[ $remote == "" ]] ; then
I'd prefer
if [[ -z "$remote" ]]; then
dim if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then · line 206
Quoted 4 lines
dim +4
-0+ 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.
I'm fond of wrapping the strings in double quotes. Gives me nicer highlighting in the editor. ;)
Otherwise seems nice.
BR,
Jani.
Quoted 135 lines
dim +46
-54+ 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!"
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [PATCH 04/10] dim: autodetect remotes, first part for dim_setup
Quoted 24 lines · Jani Nikula
Quoted 23 lines · Daniel Vetter
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_nameto a variable.Signed-off-by Daniel Vetter <[email protected]>--- dim | 112 +++++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 58 insertions(+), 54 deletions(-)dim +0
-0@@ -192,6 +192,24 @@ if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then dim_uptodate fi
Quoted 8 lines
dim if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then · line 200
Quoted 6 lines
dim +6
-0+function get_remote_name +{ + local remote_url=$1 + + local remote=`git remote -v | grep $remote_url | \ + head -n1 | sed -e 's/^\(.*\)\t.*/\1/'`'cut -f 1' seems cleaner than the sed.
Or just replace the lot with awk?
Quoted 163 lines
dim if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then · line 202
Quoted 3 lines
dim +2
-0+ + if [[ $remote == "" ]] ; thenI'd prefer
if [[ -z "$remote" ]]; thendim if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then · line 206
Quoted 4 lines
dim +4
-0+ 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.I'm fond of wrapping the strings in double quotes. Gives me nicer highlighting in the editor. ;)
Otherwise seems nice.
BR,
Jani.Quoted 135 lines
dim +46
-54+ 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!"Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 04/10] dim: autodetect remotes, first part for dim_setup
Quoted 34 lines · Ville Syrjälä
Quoted 24 lines · Jani Nikula
Quoted 23 lines · Daniel Vetter
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_nameto a variable.Signed-off-by Daniel Vetter <[email protected]>--- dim | 112 +++++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 58 insertions(+), 54 deletions(-)dim +0
-0@@ -192,6 +192,24 @@ if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then dim_uptodate fiQuoted 8 lines
dim if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then · line 200
Quoted 6 lines
dim +6
-0+function get_remote_name +{ + local remote_url=$1 + + local remote=`git remote -v | grep $remote_url | \ + head -n1 | sed -e 's/^\(.*\)\t.*/\1/'`'cut -f 1' seems cleaner than the sed.
Quoted 1 line
Or just replace the lot with awk?
Then I'd have to refresh my awk-fu, but awk is not trendy anymore...
J.
Quoted 164 lines
Quoted 164 lines
dim if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then · line 202
Quoted 4 lines
dim +2
-0+ + if [[ $remote == "" ]] ; thenI'd prefer
if [[ -z "$remote" ]]; thendim if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then · line 206
Quoted 4 lines
dim +4
-0+ 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.I'm fond of wrapping the strings in double quotes. Gives me nicer highlighting in the editor. ;)
Otherwise seems nice.
BR,
Jani.Quoted 135 lines
dim +46
-54+ 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!"Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/1 dim: autodetect branches in rebuild-nightly
In reply to Daniel VetterNeeds 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).
--- dim | 50 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 13 deletions(-)
dim +37 -13
@@ -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
Signature · 6 lines
2.9.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/10 dim: support git worktree for aux checkouts
In reply to Daniel VetterIf 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.
--- dim | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
dim +16 -7
@@ -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
Signature · 6 lines
2.9.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 05/10] dim: support git worktree for aux checkouts
Quoted 19 lines · Daniel Vetter
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 <[email protected]>--- dim | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)dim +0
-0@@ -1072,15 +1072,24 @@ function setup_aux_checkout # name remote echo "Setting up $dir ..." if [ ! -d $dir ]; then
dim function setup_aux_checkout # name remote · line 1078
Quoted 10 lines
dim +4
-6- 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
The failure modes are annoying if there's a substring match for $name. Unfortunately grep -w is no good if you need to handle "-" too.
Quoted 18 lines
dim +12
-1+ 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
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [PATCH 05/10] dim: support git worktree for aux checkouts
Quoted 7 lines · Jani Nikula
dim function setup_aux_checkout # name remote · line 1078
Quoted 4 lines
dim +4
-0+ 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 ; thenThe failure modes are annoying if there's a substring match for $name. Unfortunately grep -w is no good if you need to handle "-" too.
Hm, right. I copypasted this all over, but with drm-intel-* we have a few clashes. Played around, and the following does exact matches and gets the job done:
if [[ git branch --list $name != "" ]]
I'll roll this out in a follow up patch everywhere. -Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 6/10 dim: Nuke nightly-forget
In reply to Daniel VetterWith 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.
--- TODO | 2 -- dim | 9 --------- 2 files changed, 11 deletions(-)
TODO +0 -2
@@ -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.html
dim +0 -9
@@ -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
Signature · 6 lines
2.9.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 06/10] dim: Nuke nightly-forget
Quoted 4 lines · Daniel Vetter
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.
Agreed.
Later, we should add a helper to do the better MO.
BR,
Jani.
Quoted 40 lines
Signed-off-by Daniel Vetter <[email protected]>--- TODO | 2 -- dim | 9 --------- 2 files changed, 11 deletions(-)TODO +0
-2@@ -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.htmldim +0
-9@@ -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
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 06/10] dim: Nuke nightly-forget
Quoted 9 lines · Jani Nikula
Quoted 4 lines · Daniel Vetter
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.
Agreed.
Later, we should add a helper to do the better MO.
dim revert-rerere <rerere-cache-sha1> sounds like a sweet thing. Let me type that up and write some docs for it.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/10 dim: autodetect branches in rebuild-nightly
In reply to Daniel VetterNeeds new url-mapping information in nightly.conf to work properly.
--- dim | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-)
dim +36 -12
@@ -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
Signature · 6 lines
2.9.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 07/10] dim: autodetect branches in rebuild-nightly
Quoted 1 line · Daniel Vetter
Needs new url-mapping information in nightly.conf to work properly.
I think in the long run the right fix would be to make nightly.conf independent of remote names. Not sure if that's worth the trouble at this point.
BR,
Jani.
Quoted 133 lines
Signed-off-by Daniel Vetter <[email protected]>--- dim | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-)dim +36
-12@@ -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
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 07/10] dim: autodetect branches in rebuild-nightly
Quoted 6 lines · Jani Nikula
Quoted 1 line · Daniel Vetter
Needs new url-mapping information in nightly.conf to work properly.
I think in the long run the right fix would be to make nightly.conf independent of remote names. Not sure if that's worth the trouble at this point.
It is with this. The remote names in nightly.conf are now entirely fiction. The magic here takes those, then looks up the corresponding url (againg from nigthly.conf) and then uses get_remote_name to figure out the appropriate git remote in the local repo. Or complain and quit if it doesn't exist. My drm-tip now has an "origin" remote pointing at Linus' repo, while the "origin" from nightly.conf gets remapped to "drm-tip". Sample output from running rebuild-nightly:
Updating rerere cache and nightly.conf... Done. Fetching drm-intel (as danvet) ... Done.
Fetching drm-upstream (as airlied) ... Done. Fetching sound-upstream (as takashi) ... Done. Merging drm-intel/drm-intel-fixes... Reset. Done. Merging drm-upstream/drm-fixes... Fast-forward. Done. Merging drm-intel/drm-intel-next-fixes... Fast-forward. Done.
...
Cheers, Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 07/10] dim: autodetect branches in rebuild-nightly
Quoted 10 lines · Daniel Vetter
Quoted 6 lines · Jani Nikula
Quoted 1 line · Daniel Vetter
Needs new url-mapping information in nightly.conf to work properly.
I think in the long run the right fix would be to make nightly.conf independent of remote names. Not sure if that's worth the trouble at this point.
It is with this.
I mean, is it worth changing the nightly.conf format at this point to *not* have remote names at all, but just repo urls and branches. That's what I think should be done eventually. Because the remote names are fiction.
BR,
Jani.
Quoted 18 lines
The remote names in nightly.conf are now entirely
fiction. The magic here takes those, then looks up the corresponding url (againg from nigthly.conf) and then usesget_remote_nameto figure out the appropriate git remote in the local repo. Or complain and quit if it doesn't exist. My drm-tip now has an "origin" remote pointing at Linus' repo, while the "origin" from nightly.conf gets remapped to "drm-tip". Sample output from running rebuild-nightly:Updating rerere cache and nightly.conf... Done. Fetching drm-intel (as danvet) ... Done.
Fetching drm-upstream (as airlied) ... Done. Fetching sound-upstream (as takashi) ... Done. Merging drm-intel/drm-intel-fixes... Reset. Done. Merging drm-upstream/drm-fixes... Fast-forward. Done. Merging drm-intel/drm-intel-next-fixes... Fast-forward. Done.
...Cheers, Daniel
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/10 dim: remove integration-tree remotes
In reply to Daniel VetterWith the remotes stored in nightly.conf and git worktrees we can avoid hard-coding them in even more places.
--- dim | 12 ------------ 1 file changed, 12 deletions(-)
dim +0 -12
@@ -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!" }
Signature · 6 lines
2.9.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 9/10 dim: Split out drm-nightly.git
In reply to Daniel VetterThis 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 ;-)
--- dim | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-)
dim +15 -7
@@ -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
Signature · 6 lines
2.9.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 10/10 dim: s/drm-nightly/drm-tip
In reply to Daniel Vettertip = testing and integration pile
Also rename drm-intel-rerere directory to drm-rerere.
--- dim | 48 ++++++++++++++++++++++++------------------------ dim.rst | 16 +++++++--------- dimrc.sample | 2 +- drm-intel-flow.dot | 18 +++++++++--------- drm-intel.rst | 20 +++++++++++--------- 5 files changed, 52 insertions(+), 52 deletions(-)
dim +24 -24
@@ -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` + local nightly_remote=`get_remote_name $drm_tip_ssh` assert_branch drm-intel-next-queued 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,7 +925,7 @@ function dim_update_next function dim_update_next_continue { - local nightly_remote=`get_remote_name $drm_nightly_ssh` + local nightly_remote=`get_remote_name $drm_tip_ssh` assert_branch drm-intel-next-queued
@@ -935,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 +$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` }
dim.rst +7 -9
@@ -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...
dimrc.sample +1 -1
@@ -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.
drm-intel-flow.dot +9 -9
@@ -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"]
drm-intel.rst +11 -9
@@ -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
Signature · 6 lines
2.9.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 3 lines · Daniel Vetter
Just maybe a bit more visibility, the scripts are growing.
Signed-off-by Daniel Vetter <[email protected]>
LGTM
Quoted 89 lines
--- TODO | 27 +++++++++++++++++++++++++++ dim | 17 ----------------- qf | 11 ----------- 3 files changed, 27 insertions(+), 28 deletions(-) create mode 100644 TODOTODO new file +27
-0@@ -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.html +- 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 fetchdim +0
-17@@ -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.html -# - 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 -eqf +0
-11@@ -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/
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel