diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-07-02 22:52:14 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-07-02 22:52:14 -0700 |
commit | 5be60078c935ed08ee8eb5a32680bdfb6bb5bdf3 (patch) | |
tree | 9f68d81a31f8dfe7af6096e7beac2dc0997c143a /git-merge.sh | |
parent | 36e5e70e0f40cf7ca4351b8159d68f8560a2805f (diff) | |
download | git-5be60078c935ed08ee8eb5a32680bdfb6bb5bdf3.tar.gz |
Rewrite "git-frotz" to "git frotz"
This uses the remove-dashes target to replace "git-frotz" to "git frotz".
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-merge.sh')
-rwxr-xr-x | git-merge.sh | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/git-merge.sh b/git-merge.sh index 981d69d35f..485253032a 100755 --- a/git-merge.sh +++ b/git-merge.sh @@ -31,7 +31,7 @@ dropsave() { savestate() { # Stash away any local modifications. - git-diff-index -z --name-only $head | + git diff-index -z --name-only $head | cpio -0 -o >"$GIT_DIR/MERGE_SAVE" } @@ -40,7 +40,7 @@ restorestate() { then git reset --hard $head >/dev/null cpio -iuv <"$GIT_DIR/MERGE_SAVE" - git-update-index --refresh >/dev/null + git update-index --refresh >/dev/null fi } @@ -57,7 +57,7 @@ finish_up_to_date () { squash_message () { echo Squashed commit of the following: echo - git-log --no-merges ^"$head" $remote + git log --no-merges ^"$head" $remote } finish () { @@ -79,7 +79,7 @@ finish () { echo "No merge message -- not updating HEAD" ;; *) - git-update-ref -m "$rlogm" HEAD "$1" "$head" || exit 1 + git update-ref -m "$rlogm" HEAD "$1" "$head" || exit 1 ;; esac ;; @@ -91,7 +91,7 @@ finish () { if test "$show_diffstat" = t then # We want color (if set), but no pager - GIT_PAGER='' git-diff --stat --summary -M "$head" "$1" + GIT_PAGER='' git diff --stat --summary -M "$head" "$1" fi ;; esac @@ -99,13 +99,13 @@ finish () { merge_name () { remote="$1" - rh=$(git-rev-parse --verify "$remote^0" 2>/dev/null) || return - bh=$(git-show-ref -s --verify "refs/heads/$remote" 2>/dev/null) + rh=$(git rev-parse --verify "$remote^0" 2>/dev/null) || return + bh=$(git show-ref -s --verify "refs/heads/$remote" 2>/dev/null) if test "$rh" = "$bh" then echo "$rh branch '$remote' of ." elif truname=$(expr "$remote" : '\(.*\)~[1-9][0-9]*$') && - git-show-ref -q --verify "refs/heads/$truname" 2>/dev/null + git show-ref -q --verify "refs/heads/$truname" 2>/dev/null then echo "$rh branch '$truname' (early part) of ." elif test "$remote" = "FETCH_HEAD" -a -r "$GIT_DIR/FETCH_HEAD" @@ -170,7 +170,7 @@ do done if test -z "$show_diffstat"; then - test "$(git-config --bool merge.diffstat)" = false && show_diffstat=false + test "$(git config --bool merge.diffstat)" = false && show_diffstat=false test -z "$show_diffstat" && show_diffstat=t fi @@ -181,15 +181,15 @@ fi # have "-m" so it is an additional safety measure to check for it. if test -z "$have_message" && - second_token=$(git-rev-parse --verify "$2^0" 2>/dev/null) && - head_commit=$(git-rev-parse --verify "HEAD" 2>/dev/null) && + second_token=$(git rev-parse --verify "$2^0" 2>/dev/null) && + head_commit=$(git rev-parse --verify "HEAD" 2>/dev/null) && test "$second_token" = "$head_commit" then merge_msg="$1" shift head_arg="$1" shift -elif ! git-rev-parse --verify HEAD >/dev/null 2>&1 +elif ! git rev-parse --verify HEAD >/dev/null 2>&1 then # If the merged head is a valid one there is no reason to # forbid "git merge" into a branch yet to be born. We do @@ -203,8 +203,8 @@ then rh=$(git rev-parse --verify "$1^0") || die "$1 - not something we can merge" - git-update-ref -m "initial pull" HEAD "$rh" "" && - git-read-tree --reset -u HEAD + git update-ref -m "initial pull" HEAD "$rh" "" && + git read-tree --reset -u HEAD exit else @@ -219,11 +219,11 @@ else merge_name=$(for remote do merge_name "$remote" - done | git-fmt-merge-msg + done | git fmt-merge-msg ) merge_msg="${merge_msg:+$merge_msg$LF$LF}$merge_name" fi -head=$(git-rev-parse --verify "$head_arg"^0) || usage +head=$(git rev-parse --verify "$head_arg"^0) || usage # All the rest are remote heads test "$#" = 0 && usage ;# we need at least one remote head. @@ -232,7 +232,7 @@ set_reflog_action "merge $*" remoteheads= for remote do - remotehead=$(git-rev-parse --verify "$remote"^0 2>/dev/null) || + remotehead=$(git rev-parse --verify "$remote"^0 2>/dev/null) || die "$remote - not something we can merge" remoteheads="${remoteheads}$remotehead " eval GITHEAD_$remotehead='"$remote"' @@ -244,7 +244,7 @@ case "$use_strategies" in '') case "$#" in 1) - var="`git-config --get pull.twohead`" + var="`git config --get pull.twohead`" if test -n "$var" then use_strategies="$var" @@ -252,7 +252,7 @@ case "$use_strategies" in use_strategies="$default_twohead_strategies" fi ;; *) - var="`git-config --get pull.octopus`" + var="`git config --get pull.octopus`" if test -n "$var" then use_strategies="$var" @@ -278,10 +278,10 @@ done case "$#" in 1) - common=$(git-merge-base --all $head "$@") + common=$(git merge-base --all $head "$@") ;; *) - common=$(git-show-branch --merge-base $head "$@") + common=$(git show-branch --merge-base $head "$@") ;; esac echo "$head" >"$GIT_DIR/ORIG_HEAD" @@ -301,15 +301,15 @@ f,*) ;; ?,1,"$head",*) # Again the most common case of merging one remote. - echo "Updating $(git-rev-parse --short $head)..$(git-rev-parse --short $1)" - git-update-index --refresh 2>/dev/null + echo "Updating $(git rev-parse --short $head)..$(git rev-parse --short $1)" + git update-index --refresh 2>/dev/null msg="Fast forward" if test -n "$have_message" then msg="$msg (no commit created; -m option ignored)" fi - new_head=$(git-rev-parse --verify "$1^0") && - git-read-tree -v -m -u --exclude-per-directory=.gitignore $head "$new_head" && + new_head=$(git rev-parse --verify "$1^0") && + git read-tree -v -m -u --exclude-per-directory=.gitignore $head "$new_head" && finish "$new_head" "$msg" || exit dropsave exit 0 @@ -321,7 +321,7 @@ f,*) ?,1,*,) # We are not doing octopus, not fast forward, and have only # one common. - git-update-index --refresh 2>/dev/null + git update-index --refresh 2>/dev/null case " $use_strategies " in *' recursive '*|*' recur '*) : run merge later @@ -330,13 +330,13 @@ f,*) # See if it is really trivial. git var GIT_COMMITTER_IDENT >/dev/null || exit echo "Trying really trivial in-index merge..." - if git-read-tree --trivial -m -u -v $common $head "$1" && - result_tree=$(git-write-tree) + if git read-tree --trivial -m -u -v $common $head "$1" && + result_tree=$(git write-tree) then echo "Wonderful." result_commit=$( printf '%s\n' "$merge_msg" | - git-commit-tree $result_tree -p HEAD -p "$1" + git commit-tree $result_tree -p HEAD -p "$1" ) || exit finish "$result_commit" "In-index merge" dropsave @@ -350,7 +350,7 @@ f,*) up_to_date=t for remote do - common_one=$(git-merge-base --all $head $remote) + common_one=$(git merge-base --all $head $remote) if test "$common_one" != "$remote" then up_to_date=f @@ -419,8 +419,8 @@ do if test "$exit" -eq 1 then cnt=`{ - git-diff-files --name-only - git-ls-files --unmerged + git diff-files --name-only + git ls-files --unmerged } | wc -l` if test $best_cnt -le 0 -o $cnt -le $best_cnt then @@ -432,15 +432,15 @@ do } # Automerge succeeded. - result_tree=$(git-write-tree) && break + result_tree=$(git write-tree) && break done # If we have a resulting tree, that means the strategy module # auto resolved the merge cleanly. if test '' != "$result_tree" then - parents=$(git-show-branch --independent "$head" "$@" | sed -e 's/^/-p /') - result_commit=$(printf '%s\n' "$merge_msg" | git-commit-tree $result_tree $parents) || exit + parents=$(git show-branch --independent "$head" "$@" | sed -e 's/^/-p /') + result_commit=$(printf '%s\n' "$merge_msg" | git commit-tree $result_tree $parents) || exit finish "$result_commit" "Merge made by $wt_strategy." dropsave exit 0 @@ -498,7 +498,7 @@ Conflicts: } >>"$GIT_DIR/MERGE_MSG" if test -d "$GIT_DIR/rr-cache" then - git-rerere + git rerere fi die "Automatic merge failed; fix conflicts and then commit the result." fi |