Forced rebase on each push

6 views
Skip to first unread message

Maximilian Berghoff

unread,
Jul 31, 2015, 9:54:51 AM7/31/15
to symfony-cmf-devs
Hi, 

in my current project we have got a little shel script to force to rebase (merge in oure case) on main branch. it is just a simple

#! /usr/bin/env bash

# get the tracking-branch name
MASTER_BRANCH_NAME='origin/dev';

set -- $(git rev-list --left-right --count $MASTER_BRANCH_NAME...HEAD)
behind=$1
ahead=$2

echo "Current branch is $behind commits behind '$MASTER_BRANCH_NAME' branch";

if [ $behind -eq 0 ]
then
exit 0
else
echo "Your current branch is behind dev. Please merge with origin/dev."
exit 1
fi



what would you think to use that one before the tests too? Would force to work on the current code base.

max


David Buchmann

unread,
Jul 31, 2015, 9:58:48 AM7/31/15
to symfony-...@googlegroups.com
i would not add that. if i understand correctly, the PR build on travis
shows the tests when merging the feature branch into the target branch
so we should already see if there will be collisions or not.
> --
> You received this message because you are subscribed to the Google
> Groups "symfony-cmf-devs" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to symfony-cmf-de...@googlegroups.com
> <mailto:symfony-cmf-de...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

--
Liip AG // Agile Web Development // T +41 43 500 39 80
CH-8005 Zurich // PGP 0xA581808B // www.liip.ch

GMX - Maximilian Berghoff

unread,
Jul 31, 2015, 9:59:45 AM7/31/15
to symfony-...@googlegroups.com
but we have to rebase every PR before we merge, so this would force to
do it.

David Buchmann

unread,
Jul 31, 2015, 10:00:29 AM7/31/15
to symfony-...@googlegroups.com
we only rebase when there are merge conflicts. otherwise we just merge
and git sorts this out for us.

GMX - Maximilian Berghoff

unread,
Jul 31, 2015, 10:01:32 AM7/31/15
to symfony-...@googlegroups.com
ok, accepted.
Reply all
Reply to author
Forward
0 new messages