X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=all;h=6afd6dff9de8ef33a0113815cff93fa33e521b11;hp=65ef59b95a1b8d2860c7faa726cd6ba4bc117149;hb=885913e6b1f85adfe08f771535993d25dd75af30;hpb=1b5a7dcd166338c876b078a83ecb47456110098b diff --git a/all b/all index 65ef59b9..6afd6dff 100755 --- a/all +++ b/all @@ -117,7 +117,7 @@ data/xonotic-nexcompat.pk3dir | 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 @@ -194,8 +194,8 @@ fix_upstream_rebase() # 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` @@ -203,8 +203,8 @@ fix_upstream_rebase() 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 @@ -256,7 +256,7 @@ case "$cmd" in 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