mediasource | | master |
darkplaces | | div0-stable | svn
fteqcc | git://github.com/Blub/qclib.git | master |
-div0-gittools | git://git.icculus.org/divverent/div0-gittools.git | master |
+div0-gittools | | master |
netradiant | | master |
"
# todo: in darkplaces, change repobranch to div0-stable
# no merge-base? upstream did filter-branch
if [ -n "$r_base" ]; then
# otherwise, check if the two histories are "similar"
- r_l_me=`git log --pretty="format:%s" "$r_other".."$r_me" | grep -v "^Merged" | sort -u`
- r_l_other=`git log --pretty="format:%s" "$r_me".."$r_other" | grep -v "^Merged" | sort -u`
+ r_l_me=`git log --pretty="format:%s" "$r_other".."$r_me" | grep -v "^Merge" | sort -u`
+ r_l_other=`git log --pretty="format:%s" "$r_me".."$r_other" | grep -v "^Merge" | sort -u`
# heuristics: upstream rebase/filter-branch if more than 50% of the commits of one of the sides are in the other too
r_lc_me=`echo "$r_l_me" | wc -l`
r_lc_together=`{ echo "$r_l_me"; echo "$r_l_other"; } | sort -u | wc -l`
r_lc_same=$(($r_lc_me + $r_lc_other - $r_lc_together))
- if [ $(( $r_lc_same * 2 )) -le $(( $r_lc_me )) ] && [ $(( $r_lc_same * 2 )) -le $(( $r_lc_other )) ]; then
- if yesno "Probable upstream rebase detected, automatically fix?" 'git log --oneline --graph --left-right "$r_l_other".."$r_l_me"'; then
+ if [ $(( $r_lc_same * 2 )) -gt $(( $r_lc_me )) ] || [ $(( $r_lc_same * 2 )) -gt $(( $r_lc_other )) ]; then
+ if yesno "Probable upstream rebase detected, automatically fix?" 'git log --oneline --graph --date-order --left-right "$r_other"..."$r_me"'; then
git reset --hard "$r_me"
git pull --rebase
return 1
r=${r#refs/heads/}
if git config branch.$r.remote >/dev/null 2>&1; then
if ! verbose git pull; then
- fix_upstream_rebase_mergefailed || true
+ fix_upstream_rebase_mergefail || true
check_mergeconflict "$d"
echo "Pulling failed. Press ENTER to continue, or Ctrl-C to abort."
read -r DUMMY