From 04df1b5a8380fbbd8df59cdba6e6abddcc19ec3c Mon Sep 17 00:00:00 2001 From: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Tue, 28 Oct 2014 10:08:37 +0100 Subject: [PATCH] dim: Handle fast-forwards separately in update_nightly We've had tons of fun in the past with -nightly merge commits, e.g. commit e47410aa424c8ee740eb9add9b50ac1ca7ce12a0 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. --- dim | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/dim b/dim index 80759d2..bf2f9e8 100755 --- a/dim +++ b/dim @@ -223,6 +223,9 @@ function update_nightly if [ $first == 1 ] ; then 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 + true else local fixup_file=$rerere/$integration_branch-$name-fixup.patch @@ -236,14 +239,9 @@ function update_nightly check_conflicts git add -u - if [[ `git diff --cached --name-status | wc -l` -gt 0 ]]; then - # If the conflict is silent git merge succeeded, - # so there's no cached commit message around. - # 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 + # because we filter out fast-forward merges there will + # always be something to commit + git commit --no-edit fi echo -e "$branch `git rev-parse $sha1`\n\t`git log -1 $sha1 --pretty=format:%s`" >> $specfile -- GitLab