Skip to content
Snippets Groups Projects
Commit b58b3b8b 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.

v9: Create a separate rerere_remote for the rerere-cache branch. It
might be in a difference local git repository (Jani).

Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
parent aa806bd9
No related branches found
No related tags found
No related merge requests found
......@@ -223,6 +223,14 @@ function url_to_remote # url
echo $remote
}
function branch_to_remote # branch
{
local remote=`git rev-parse --abbrev-ref --symbolic-full-name $1@{upstream}`
remote=${remote%%/*}
echo $remote
}
function dim_uptodate
{
local using="${BASH_SOURCE[0]}"
......@@ -431,7 +439,9 @@ function dim_rebuild_nightly
echo -n "Updating rerere cache... "
cd $rerere
if git branch --list rerere-cache | grep '\*' >& /dev/null ; then
if git branch --list rerere-cache | grep -q '\*' ; then
local rerere_remote=`branch_to_remote rerere-cache`
git pull >& /dev/null
cp `rr_cache_dir`/* rr-cache -r
git add *.patch >& /dev/null || true
......@@ -442,7 +452,7 @@ function dim_rebuild_nightly
echo -n "Nothing changed. "
fi
echo -n "Pushing rerere cache... "
git push $DRY_RUN $nightly_remote HEAD >& /dev/null && echo "Done."
git push $DRY_RUN $rerere_remote HEAD >& /dev/null && echo "Done."
else
echo "Fail: Branch setup for the rerere-cache is borked."
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