Skip to content
Snippets Groups Projects
Commit aa806bd9 authored by Simona Vetter's avatar Simona Vetter
Browse files

dim: autodetect branches in rebuild-nightly


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

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

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

v4: Rebasing.

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

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

v7: Move misplaced hunks to right place.

v8: For the nightly remote use nightly_remote instead of anything
called origin - it's confusing.

Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
parent f33ee9b1
No related branches found
No related tags found
No related merge requests found
...@@ -277,16 +277,18 @@ function update_linux_next ...@@ -277,16 +277,18 @@ function update_linux_next
{ {
cd $DIM_PREFIX/drm-intel-nightly cd $DIM_PREFIX/drm-intel-nightly
local remote=`url_to_remote $drm_intel_ssh`
# always update drm-intel-fixes # always update drm-intel-fixes
echo -n "Pushing drm-intel-fixes to for-linux-next-fixes... " echo -n "Pushing drm-intel-fixes to for-linux-next-fixes... "
git push $DRY_RUN origin +origin/drm-intel-fixes:for-linux-next-fixes >& /dev/null git push $DRY_RUN $remote +$remote/drm-intel-fixes:for-linux-next-fixes >& /dev/null
echo "Done." echo "Done."
if git merge-base --is-ancestor origin/drm-intel-next-fixes origin/drm-intel-fixes ; then if git merge-base --is-ancestor $remote/drm-intel-next-fixes $remote/drm-intel-fixes ; then
# -fixes has caught up to dinf, i.e. we're out of the merge # -fixes has caught up to dinf, i.e. we're out of the merge
# window. Push the next queue. # window. Push the next queue.
echo -n "Out of merge window. Pushing drm-intel-next-queued to for-linux-next... " echo -n "Out of merge window. Pushing drm-intel-next-queued to for-linux-next... "
git push $DRY_RUN origin +origin/drm-intel-next-queued:for-linux-next >& /dev/null git push $DRY_RUN $remote +$remote/drm-intel-next-queued:for-linux-next >& /dev/null
echo "Done." echo "Done."
else else
# dinf is ahead of -fixes, i.e. drm-next has already closed for # dinf is ahead of -fixes, i.e. drm-next has already closed for
...@@ -294,7 +296,7 @@ function update_linux_next ...@@ -294,7 +296,7 @@ function update_linux_next
# for the current -next cycle. Push dinf # for the current -next cycle. Push dinf
echo -n "Pushing drm-intel-next-fixes to for-linux-next... " echo -n "Pushing drm-intel-next-fixes to for-linux-next... "
git push $DRY_RUN origin +origin/drm-intel-next-fixes:for-linux-next >& /dev/null git push $DRY_RUN $remote +$remote/drm-intel-next-fixes:for-linux-next >& /dev/null
echo "Done." echo "Done."
fi fi
} }
...@@ -362,9 +364,10 @@ function dim_rebuild_nightly ...@@ -362,9 +364,10 @@ function dim_rebuild_nightly
exit 1 exit 1
fi fi
for url in "${drm_tip_repos[@]}"; do for repo in "${!drm_tip_repos[@]}"; do
local url=${drm_tip_repos[$repo]}
local remote=$(url_to_remote $url) local remote=$(url_to_remote $url)
echo -n "Fetching $remote... " echo -n "Fetching $repo (as $remote) ... "
# git fetch returns 128 if there's nothing to be fetched # git fetch returns 128 if there's nothing to be fetched
git fetch $remote >& /dev/null || true git fetch $remote >& /dev/null || true
echo "Done." echo "Done."
...@@ -385,8 +388,8 @@ function dim_rebuild_nightly ...@@ -385,8 +388,8 @@ function dim_rebuild_nightly
fi fi
if [ $first == 1 ] ; then if [ $first == 1 ] ; then
git reset --hard $sha1 &> /dev/null
echo "Reset. Done." echo "Reset. Done."
git reset --hard $sha1 >& /dev/null
first=0 first=0
elif git merge --rerere-autoupdate --ff-only $sha1 >& /dev/null ; then elif git merge --rerere-autoupdate --ff-only $sha1 >& /dev/null ; then
# nothing to do if just fast-forward # nothing to do if just fast-forward
...@@ -421,8 +424,10 @@ function dim_rebuild_nightly ...@@ -421,8 +424,10 @@ function dim_rebuild_nightly
git commit --quiet -m "$integration_branch: $time integration manifest" git commit --quiet -m "$integration_branch: $time integration manifest"
echo "Done." echo "Done."
local nightly_remote=`url_to_remote $drm_intel_ssh`
echo -n "Pushing $integration_branch... " echo -n "Pushing $integration_branch... "
git push $DRY_RUN origin +HEAD >& /dev/null && echo "Done." git push $DRY_RUN $nightly_remote +HEAD >& /dev/null && echo "Done."
echo -n "Updating rerere cache... " echo -n "Updating rerere cache... "
cd $rerere cd $rerere
...@@ -437,7 +442,7 @@ function dim_rebuild_nightly ...@@ -437,7 +442,7 @@ function dim_rebuild_nightly
echo -n "Nothing changed. " echo -n "Nothing changed. "
fi fi
echo -n "Pushing rerere cache... " echo -n "Pushing rerere cache... "
git push $DRY_RUN origin HEAD >& /dev/null && echo "Done." git push $DRY_RUN $nightly_remote HEAD >& /dev/null && echo "Done."
else else
echo "Fail: Branch setup for the rerere-cache is borked." echo "Fail: Branch setup for the rerere-cache is borked."
exit 1 exit 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment