Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 55 lines (50 sloc) 0.944 kb
91063bb Multi-backend merge driver.
Junio C Hamano authored
1 #!/bin/sh
2 #
3 # Copyright (c) 2005 Linus Torvalds
2276aa6 Use Daniel's read-tree in the merge strategy 'resolve'.
Junio C Hamano authored
4 # Copyright (c) 2005 Junio C Hamano
91063bb Multi-backend merge driver.
Junio C Hamano authored
5 #
3dff537 @proski Assorted typo fixes
proski authored
6 # Resolve two trees, using enhanced multi-base read-tree.
91063bb Multi-backend merge driver.
Junio C Hamano authored
7
8 # The first parameters up to -- are merge bases; the rest are heads.
9 bases= head= remotes= sep_seen=
10 for arg
11 do
12 case ",$sep_seen,$head,$arg," in
13 *,--,)
14 sep_seen=yes
15 ;;
16 ,yes,,*)
17 head=$arg
18 ;;
19 ,yes,*)
20 remotes="$remotes$arg "
21 ;;
22 *)
23 bases="$bases$arg "
24 ;;
25 esac
26 done
27
7d3c82a @pinetops Fixing comment in merge strategies
pinetops authored
28 # Give up if we are given two or more remotes -- not handling octopus.
91063bb Multi-backend merge driver.
Junio C Hamano authored
29 case "$remotes" in
30 ?*' '?*)
31 exit 2 ;;
32 esac
33
88f8f0a [PATCH] Enable and fix support for base less merges.
Fredrik Kuivinen authored
34 # Give up if this is a baseless merge.
35 if test '' = "$bases"
36 then
37 exit 2
38 fi
39
7bd93c1 Convert to use quiet option when available
Dan Loewenherz authored
40 git update-index -q --refresh
5be6007 @gitster Rewrite "git-frotz" to "git frotz"
authored
41 git read-tree -u -m --aggressive $bases $head $remotes || exit 2
91063bb Multi-backend merge driver.
Junio C Hamano authored
42 echo "Trying simple merge."
7bd93c1 Convert to use quiet option when available
Dan Loewenherz authored
43 if result_tree=$(git write-tree 2>/dev/null)
91063bb Multi-backend merge driver.
Junio C Hamano authored
44 then
45 exit 0
46 else
47 echo "Simple merge failed, trying Automatic merge."
48 if git-merge-index -o git-merge-one-file -a
49 then
50 exit 0
51 else
52 exit 1
53 fi
54 fi
Something went wrong with that request. Please try again.