PATH:
usr
/
libexec
/
git-core
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # # Resolve two or more trees. # LF=' ' die () { echo >&2 "$*" exit 1 } # The first parameters up to -- are merge bases; the rest are heads. bases= head= remotes= sep_seen= for arg do case ",$sep_seen,$head,$arg," in *,--,) sep_seen=yes ;; ,yes,,*) head=$arg ;; ,yes,*) remotes="$remotes$arg " ;; *) bases="$bases$arg " ;; esac done # Reject if this is not an Octopus -- resolve should be used instead. case "$remotes" in ?*' '?*) ;; *) exit 2 ;; esac # MRC is the current "merge reference commit" # MRT is the current "merge result tree" MRC=$(git rev-parse --verify -q $head) MRT=$(git write-tree) NON_FF_MERGE=0 OCTOPUS_FAILURE=0 for SHA1 in $remotes do case "$OCTOPUS_FAILURE" in 1) # We allow only last one to have a hand-resolvable # conflicts. Last round failed and we still had # a head to merge. echo "Automated merge did not work." echo "Should not be doing an Octopus." exit 2 esac eval pretty_name=\${GITHEAD_$SHA1:-$SHA1} if test "$SHA1" = "$pretty_name" then SHA1_UP="$(echo "$SHA1" | tr a-z A-Z)" eval pretty_name=\${GITHEAD_$SHA1_UP:-$pretty_name} fi common=$(git merge-base --all $SHA1 $MRC) || die "Unable to find common commit with $pretty_name" case "$LF$common$LF" in *"$LF$SHA1$LF"*) echo "Already up-to-date with $pretty_name" continue ;; esac if test "$common,$NON_FF_MERGE" = "$MRC,0" then # The first head being merged was a fast-forward. # Advance MRC to the head being merged, and use that # tree as the intermediate result of the merge. # We still need to count this as part of the parent set. echo "Fast-forwarding to: $pretty_name" git read-tree -u -m $head $SHA1 || exit MRC=$SHA1 MRT=$(git write-tree) continue fi NON_FF_MERGE=1 echo "Trying simple merge with $pretty_name" git read-tree -u -m --aggressive $common $MRT $SHA1 || exit 2 next=$(git write-tree 2>/dev/null) if test $? -ne 0 then echo "Simple merge did not work, trying automatic merge." git-merge-index -o git-merge-one-file -a || OCTOPUS_FAILURE=1 next=$(git write-tree 2>/dev/null) fi MRC="$MRC $SHA1" MRT=$next done exit "$OCTOPUS_FAILURE"
[+]
..
[-] git-sh-setup
[edit]
[-] git-bisect--helper
[edit]
[-] git-check-attr
[edit]
[-] git-show
[edit]
[-] git-receive-pack
[edit]
[-] git-bundle
[edit]
[-] git-config
[edit]
[-] git-merge-recursive
[edit]
[-] git-imap-send
[edit]
[-] git-remote-testpy
[edit]
[-] git-revert
[edit]
[-] git-mergetool
[edit]
[-] git-rev-parse
[edit]
[-] git-sh-i18n--envsubst
[edit]
[-] git-fast-export
[edit]
[-] git-fmt-merge-msg
[edit]
[-] git-whatchanged
[edit]
[-] git-submodule--helper
[edit]
[-] git-reflog
[edit]
[-] git-column
[edit]
[-] git-prune-packed
[edit]
[-] git-credential-cache
[edit]
[-] git-upload-pack
[edit]
[-] git
[edit]
[-] git-remote-http
[edit]
[-] git-difftool
[edit]
[-] git-request-pull
[edit]
[-] git-merge-subtree
[edit]
[-] git-parse-remote
[edit]
[-] git-fetch-pack
[edit]
[-] git-send-pack
[edit]
[-] git-diff-index
[edit]
[-] git-cherry
[edit]
[-] git-ls-files
[edit]
[-] git-show-index
[edit]
[-] git-unpack-objects
[edit]
[-] git-write-tree
[edit]
[-] git-upload-archive
[edit]
[-] git-merge-index
[edit]
[-] git-gc
[edit]
[-] git-init-db
[edit]
[-] git-diff
[edit]
[-] git-credential
[edit]
[-] git-notes
[edit]
[-] git-for-each-ref
[edit]
[-] git-symbolic-ref
[edit]
[-] git-diff-files
[edit]
[-] git-fetch
[edit]
[-] git-merge-tree
[edit]
[-] git-update-index
[edit]
[-] git-diff-tree
[edit]
[-] git-commit
[edit]
[-] git-tag
[edit]
[-] git-cat-file
[edit]
[-] git-remote-fd
[edit]
[-] git-rebase--merge
[edit]
[-] git-bisect
[edit]
[-] git-sh-i18n
[edit]
[-] git-cherry-pick
[edit]
[-] git-checkout-index
[edit]
[-] git-credential-store
[edit]
[-] git-annotate
[edit]
[-] git-stage
[edit]
[-] git-remote-https
[edit]
[-] git-patch-id
[edit]
[-] git-branch
[edit]
[-] git-var
[edit]
[-] git-rm
[edit]
[-] git-help
[edit]
[-] git-commit-tree
[edit]
[-] git-merge
[edit]
[-] git-reset
[edit]
[-] git-stripspace
[edit]
[-] git-pack-refs
[edit]
[-] git-lost-found
[edit]
[-] git-show-ref
[edit]
[-] git-update-server-info
[edit]
[-] git-check-ignore
[edit]
[-] git-am
[edit]
[-] git-check-ref-format
[edit]
[-] git-hash-object
[edit]
[-] git-ls-tree
[edit]
[-] git-apply
[edit]
[-] git-format-patch
[edit]
[-] git-verify-tag
[edit]
[-] git-fsck-objects
[edit]
[-] git-tar-tree
[edit]
[-] git-read-tree
[edit]
[-] git-update-ref
[edit]
[-] git-count-objects
[edit]
[-] git-fast-import
[edit]
[-] git-mergetool--lib
[edit]
[-] git-push
[edit]
[-] git-subtree
[edit]
[-] git-rebase--am
[edit]
[-] git-merge-ours
[edit]
[-] git-remote-ftps
[edit]
[-] git-blame
[edit]
[-] git-init
[edit]
[-] git-merge-one-file
[edit]
[-] git-show-branch
[edit]
[-] git-clone
[edit]
[-] git-rebase
[edit]
[-] git-remote
[edit]
[-] git-rerere
[edit]
[-] git-ls-remote
[edit]
[-] git-merge-resolve
[edit]
[-] git-rev-list
[edit]
[-] git-pack-objects
[edit]
[-] git-fsck
[edit]
[-] git-rebase--interactive
[edit]
[-] git-mv
[edit]
[-] git-unpack-file
[edit]
[-] git-http-fetch
[edit]
[-] git-shell
[edit]
[-] git-status
[edit]
[-] git-shortlog
[edit]
[-] git-verify-pack
[edit]
[-] git-name-rev
[edit]
[+]
mergetools
[-] git-merge-file
[edit]
[-] git-web--browse
[edit]
[-] git-remote-ext
[edit]
[-] git-grep
[edit]
[-] git-mktree
[edit]
[-] git-credential-cache--daemon
[edit]
[-] git-stash
[edit]
[-] git-add--interactive
[edit]
[-] git-checkout
[edit]
[-] git-pull
[edit]
[-] git-replace
[edit]
[-] git-merge-octopus
[edit]
[-] git-mailsplit
[edit]
[-] git-clean
[edit]
[-] git-repack
[edit]
[-] git-add
[edit]
[-] git-peek-remote
[edit]
[-] git-http-push
[edit]
[-] git-log
[edit]
[-] git-prune
[edit]
[-] git-get-tar-commit-id
[edit]
[-] git-repo-config
[edit]
[-] git-mktag
[edit]
[-] git-http-backend
[edit]
[-] git-index-pack
[edit]
[-] git-difftool--helper
[edit]
[-] git-submodule
[edit]
[-] git-relink
[edit]
[-] git-remote-ftp
[edit]
[-] git-merge-base
[edit]
[-] git-describe
[edit]
[-] git-filter-branch
[edit]
[-] git-mailinfo
[edit]
[-] git-archive
[edit]
[-] git-pack-redundant
[edit]
[-] git-quiltimport
[edit]