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

dim: Handle fast-forwards separately in update_nightly

We've had tons of fun in the past with -nightly merge commits, e.g.

commit e47410aa
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Sep 8 08:52:41 2014 +0200

    dim: cope better with silent conflict fixup patches

Now another kind of fun showed up, namely when a merge is just a
fast-forward without any content changes. That lead to the git diff
--cached check failing, which lead to not committing the merge, which
lead to to all subsequent merges failing too.

Since this is all too fragile rework the logic a bit and first filter
out the fast-forward merges. With those handled we know that there
will be a real merge and so always something to commit. Which also
means that we'll never have fun again with fixup patches getting lost.
Hopefully.
parent e0c480a6
No related branches found
No related tags found
No related merge requests found
...@@ -223,6 +223,9 @@ function update_nightly ...@@ -223,6 +223,9 @@ function update_nightly
if [ $first == 1 ] ; then if [ $first == 1 ] ; then
git reset --hard $sha1 >& /dev/null git reset --hard $sha1 >& /dev/null
first=0 first=0
elif git merge --rerere-autoupdate --ff-only $sha1 >& /dev/null ; then
# nothing to do if just fast-forward
true
else else
local fixup_file=$rerere/$integration_branch-$name-fixup.patch local fixup_file=$rerere/$integration_branch-$name-fixup.patch
...@@ -236,14 +239,9 @@ function update_nightly ...@@ -236,14 +239,9 @@ function update_nightly
check_conflicts check_conflicts
git add -u git add -u
if [[ `git diff --cached --name-status | wc -l` -gt 0 ]]; then # because we filter out fast-forward merges there will
# If the conflict is silent git merge succeeded, # always be something to commit
# so there's no cached commit message around. git commit --no-edit
# Since it's too hard to detect this reliably
# (git scripting is fragile) just try a second
# time with a commit message supplied.
git commit --no-edit || git commit -m "Applying $fixup_file"
fi
fi fi
echo -e "$branch `git rev-parse $sha1`\n\t`git log -1 $sha1 --pretty=format:%s`" >> $specfile echo -e "$branch `git rev-parse $sha1`\n\t`git log -1 $sha1 --pretty=format:%s`" >> $specfile
......
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