# This shell script fragment is sourced by git-rebase to implement # its merge-based non-interactive mode that copes well with renamed # files. # # Copyright (c) 2010 Junio C Hamano. # prec=4 read_state () { onto_name=$(cat "$state_dir"/onto_name) && end=$(cat "$state_dir"/end) && msgnum=$(cat "$state_dir"/msgnum) } continue_merge () { test -d "$state_dir" || die "$state_dir directory does not exist" unmerged=$(git ls-files -u) if test -n "$unmerged" then echo "You still have unmerged paths in your index" echo "did you forget to use git add?" die "$resolvemsg" fi cmt=$(cat "$state_dir/current") if ! git diff-index --quiet --ignore-submodules HEAD -- then if ! git commit ${gpg_sign_opt:+"$gpg_sign_opt"} $allow_empty_message \ --no-verify -C "$cmt" then echo "Commit failed, please do not call \"git commit\"" echo "directly, but instead do one of the following: " die "$resolvemsg" fi if test -z "$GIT_QUIET" then printf "Committed: %0${prec}d " $msgnum fi echo "$cmt $(git rev-parse HEAD^0)" >> "$state_dir/rewritten" else if test -z "$GIT_QUIET" then printf "Already applied: %0${prec}d " $msgnum fi fi test -z "$GIT_QUIET" && GIT_PAGER='' git log --format=%s -1 "$cmt" # onto the next patch: msgnum=$(($msgnum + 1)) echo "$msgnum" >"$state_dir/msgnum" } call_merge () { msgnum="$1" echo "$msgnum" >"$state_dir/msgnum" cmt="$(cat "$state_dir/cmt.$msgnum")" echo "$cmt" > "$state_dir/current" git update-ref REBASE_HEAD "$cmt" hd=$(git rev-parse --verify HEAD) cmt_name=$(git symbolic-ref HEAD 2> /dev/null || echo HEAD) eval GITHEAD_$cmt='"${cmt_name##refs/heads/}~$(($end - $msgnum))"' eval GITHEAD_$hd='$onto_name' export GITHEAD_$cmt GITHEAD_$hd if test -n "$GIT_QUIET" then GIT_MERGE_VERBOSITY=1 && export GIT_MERGE_VERBOSITY fi test -z "$strategy" && strategy=recursive # If cmt doesn't have a parent, don't include it as a base base=$(git rev-parse --verify --quiet $cmt^) eval 'git-merge-$strategy' $strategy_opts $base ' -- "$hd" "$cmt"' rv=$? case "$rv" in 0) unset GITHEAD_$cmt GITHEAD_$hd return ;; 1) git rerere $allow_rerere_autoupdate die "$resolvemsg" ;; 2) echo "Strategy: $strategy failed, try another" 1>&2 die "$resolvemsg" ;; *) die "Unknown exit code ($rv) from command:" \ "git-merge-$strategy $cmt^ -- HEAD $cmt" ;; esac } finish_rb_merge () { move_to_original_branch if test -s "$state_dir"/rewritten then git notes copy --for-rewrite=rebase <"$state_dir"/rewritten hook="$(git rev-parse --git-path hooks/post-rewrite)" test -x "$hook" && "$hook" rebase <"$state_dir"/rewritten fi say All done. } # The whole contents of this file is run by dot-sourcing it from # inside a shell function. It used to be that "return"s we see # below were not inside any function, and expected to return # to the function that dot-sourced us. # # However, older (9.x) versions of FreeBSD /bin/sh misbehave on such a # construct and continue to run the statements that follow such a "return". # As a work-around, we introduce an extra layer of a function # here, and immediately call it after defining it. git_rebase__merge () { case "$action" in continue) read_state continue_merge while test "$msgnum" -le "$end" do call_merge "$msgnum" continue_merge done finish_rb_merge return ;; skip) read_state git rerere clear msgnum=$(($msgnum + 1)) while test "$msgnum" -le "$end" do call_merge "$msgnum" continue_merge done finish_rb_merge return ;; show-current-patch) exec git show REBASE_HEAD -- ;; esac mkdir -p "$state_dir" echo "$onto_name" > "$state_dir/onto_name" write_basic_state rm -f "$(git rev-parse --git-path REBASE_HEAD)" msgnum=0 for cmt in $(git rev-list --reverse --no-merges "$revisions") do msgnum=$(($msgnum + 1)) echo "$cmt" > "$state_dir/cmt.$msgnum" done echo 1 >"$state_dir/msgnum" echo $msgnum >"$state_dir/end" end=$msgnum msgnum=1 while test "$msgnum" -le "$end" do call_merge "$msgnum" continue_merge done finish_rb_merge } # ... and then we call the whole thing. git_rebase__merge
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
mergetools | Folder | 0755 |
|
|
git | File | 2.27 MB | 0755 |
|
git-add | File | 2.27 MB | 0755 |
|
git-add--interactive | File | 42.89 KB | 0755 |
|
git-am | File | 2.27 MB | 0755 |
|
git-annotate | File | 2.27 MB | 0755 |
|
git-apply | File | 2.27 MB | 0755 |
|
git-archive | File | 2.27 MB | 0755 |
|
git-bisect | File | 14.11 KB | 0755 |
|
git-bisect--helper | File | 2.27 MB | 0755 |
|
git-blame | File | 2.27 MB | 0755 |
|
git-branch | File | 2.27 MB | 0755 |
|
git-bundle | File | 2.27 MB | 0755 |
|
git-cat-file | File | 2.27 MB | 0755 |
|
git-check-attr | File | 2.27 MB | 0755 |
|
git-check-ignore | File | 2.27 MB | 0755 |
|
git-check-mailmap | File | 2.27 MB | 0755 |
|
git-check-ref-format | File | 2.27 MB | 0755 |
|
git-checkout | File | 2.27 MB | 0755 |
|
git-checkout-index | File | 2.27 MB | 0755 |
|
git-cherry | File | 2.27 MB | 0755 |
|
git-cherry-pick | File | 2.27 MB | 0755 |
|
git-clean | File | 2.27 MB | 0755 |
|
git-clone | File | 2.27 MB | 0755 |
|
git-column | File | 2.27 MB | 0755 |
|
git-commit | File | 2.27 MB | 0755 |
|
git-commit-tree | File | 2.27 MB | 0755 |
|
git-config | File | 2.27 MB | 0755 |
|
git-count-objects | File | 2.27 MB | 0755 |
|
git-credential | File | 2.27 MB | 0755 |
|
git-credential-cache | File | 1.26 MB | 0755 |
|
git-credential-cache--daemon | File | 1.27 MB | 0755 |
|
git-credential-store | File | 1.27 MB | 0755 |
|
git-daemon | File | 1.28 MB | 0755 |
|
git-describe | File | 2.27 MB | 0755 |
|
git-diff | File | 2.27 MB | 0755 |
|
git-diff-files | File | 2.27 MB | 0755 |
|
git-diff-index | File | 2.27 MB | 0755 |
|
git-diff-tree | File | 2.27 MB | 0755 |
|
git-difftool | File | 2.27 MB | 0755 |
|
git-difftool--helper | File | 2.19 KB | 0755 |
|
git-fast-export | File | 2.27 MB | 0755 |
|
git-fast-import | File | 1.3 MB | 0755 |
|
git-fetch | File | 2.27 MB | 0755 |
|
git-fetch-pack | File | 2.27 MB | 0755 |
|
git-filter-branch | File | 15.17 KB | 0755 |
|
git-fmt-merge-msg | File | 2.27 MB | 0755 |
|
git-for-each-ref | File | 2.27 MB | 0755 |
|
git-format-patch | File | 2.27 MB | 0755 |
|
git-fsck | File | 2.27 MB | 0755 |
|
git-fsck-objects | File | 2.27 MB | 0755 |
|
git-gc | File | 2.27 MB | 0755 |
|
git-get-tar-commit-id | File | 2.27 MB | 0755 |
|
git-grep | File | 2.27 MB | 0755 |
|
git-hash-object | File | 2.27 MB | 0755 |
|
git-help | File | 2.27 MB | 0755 |
|
git-http-backend | File | 1.27 MB | 0755 |
|
git-http-fetch | File | 1.31 MB | 0755 |
|
git-http-push | File | 1.32 MB | 0755 |
|
git-imap-send | File | 1.32 MB | 0755 |
|
git-index-pack | File | 2.27 MB | 0755 |
|
git-init | File | 2.27 MB | 0755 |
|
git-init-db | File | 2.27 MB | 0755 |
|
git-instaweb | File | 18.11 KB | 0755 |
|
git-interpret-trailers | File | 2.27 MB | 0755 |
|
git-log | File | 2.27 MB | 0755 |
|
git-ls-files | File | 2.27 MB | 0755 |
|
git-ls-remote | File | 2.27 MB | 0755 |
|
git-ls-tree | File | 2.27 MB | 0755 |
|
git-mailinfo | File | 2.27 MB | 0755 |
|
git-mailsplit | File | 2.27 MB | 0755 |
|
git-merge | File | 2.27 MB | 0755 |
|
git-merge-base | File | 2.27 MB | 0755 |
|
git-merge-file | File | 2.27 MB | 0755 |
|
git-merge-index | File | 2.27 MB | 0755 |
|
git-merge-octopus | File | 2.42 KB | 0755 |
|
git-merge-one-file | File | 3.62 KB | 0755 |
|
git-merge-ours | File | 2.27 MB | 0755 |
|
git-merge-recursive | File | 2.27 MB | 0755 |
|
git-merge-resolve | File | 944 B | 0755 |
|
git-merge-subtree | File | 2.27 MB | 0755 |
|
git-merge-tree | File | 2.27 MB | 0755 |
|
git-mergetool | File | 10.06 KB | 0755 |
|
git-mergetool--lib | File | 8.66 KB | 0644 |
|
git-mktag | File | 2.27 MB | 0755 |
|
git-mktree | File | 2.27 MB | 0755 |
|
git-mv | File | 2.27 MB | 0755 |
|
git-name-rev | File | 2.27 MB | 0755 |
|
git-notes | File | 2.27 MB | 0755 |
|
git-pack-objects | File | 2.27 MB | 0755 |
|
git-pack-redundant | File | 2.27 MB | 0755 |
|
git-pack-refs | File | 2.27 MB | 0755 |
|
git-parse-remote | File | 2.59 KB | 0644 |
|
git-patch-id | File | 2.27 MB | 0755 |
|
git-prune | File | 2.27 MB | 0755 |
|
git-prune-packed | File | 2.27 MB | 0755 |
|
git-pull | File | 2.27 MB | 0755 |
|
git-push | File | 2.27 MB | 0755 |
|
git-quiltimport | File | 3.51 KB | 0755 |
|
git-read-tree | File | 2.27 MB | 0755 |
|
git-rebase | File | 16.89 KB | 0755 |
|
git-rebase--am | File | 2.62 KB | 0644 |
|
git-rebase--helper | File | 2.27 MB | 0755 |
|
git-rebase--interactive | File | 28.25 KB | 0644 |
|
git-rebase--merge | File | 4 KB | 0644 |
|
git-receive-pack | File | 2.27 MB | 0755 |
|
git-reflog | File | 2.27 MB | 0755 |
|
git-remote | File | 2.27 MB | 0755 |
|
git-remote-ext | File | 2.27 MB | 0755 |
|
git-remote-fd | File | 2.27 MB | 0755 |
|
git-remote-ftp | File | 1.32 MB | 0755 |
|
git-remote-ftps | File | 1.32 MB | 0755 |
|
git-remote-http | File | 1.32 MB | 0755 |
|
git-remote-https | File | 1.32 MB | 0755 |
|
git-remote-testsvn | File | 1.28 MB | 0755 |
|
git-repack | File | 2.27 MB | 0755 |
|
git-replace | File | 2.27 MB | 0755 |
|
git-request-pull | File | 3.61 KB | 0755 |
|
git-rerere | File | 2.27 MB | 0755 |
|
git-reset | File | 2.27 MB | 0755 |
|
git-rev-list | File | 2.27 MB | 0755 |
|
git-rev-parse | File | 2.27 MB | 0755 |
|
git-revert | File | 2.27 MB | 0755 |
|
git-rm | File | 2.27 MB | 0755 |
|
git-send-pack | File | 2.27 MB | 0755 |
|
git-sh-i18n | File | 2.3 KB | 0644 |
|
git-sh-i18n--envsubst | File | 1.26 MB | 0755 |
|
git-sh-prompt | File | 16 KB | 0644 |
|
git-sh-setup | File | 9.04 KB | 0644 |
|
git-shell | File | 1.26 MB | 0755 |
|
git-shortlog | File | 2.27 MB | 0755 |
|
git-show | File | 2.27 MB | 0755 |
|
git-show-branch | File | 2.27 MB | 0755 |
|
git-show-index | File | 1.26 MB | 0755 |
|
git-show-ref | File | 2.27 MB | 0755 |
|
git-stage | File | 2.27 MB | 0755 |
|
git-stash | File | 15.12 KB | 0755 |
|
git-status | File | 2.27 MB | 0755 |
|
git-stripspace | File | 2.27 MB | 0755 |
|
git-submodule | File | 23.38 KB | 0755 |
|
git-submodule--helper | File | 2.27 MB | 0755 |
|
git-subtree | File | 16.11 KB | 0755 |
|
git-symbolic-ref | File | 2.27 MB | 0755 |
|
git-tag | File | 2.27 MB | 0755 |
|
git-unpack-file | File | 2.27 MB | 0755 |
|
git-unpack-objects | File | 2.27 MB | 0755 |
|
git-update-index | File | 2.27 MB | 0755 |
|
git-update-ref | File | 2.27 MB | 0755 |
|
git-update-server-info | File | 2.27 MB | 0755 |
|
git-upload-archive | File | 2.27 MB | 0755 |
|
git-upload-pack | File | 1.27 MB | 0755 |
|
git-var | File | 2.27 MB | 0755 |
|
git-verify-commit | File | 2.27 MB | 0755 |
|
git-verify-pack | File | 2.27 MB | 0755 |
|
git-verify-tag | File | 2.27 MB | 0755 |
|
git-web--browse | File | 4.3 KB | 0755 |
|
git-whatchanged | File | 2.27 MB | 0755 |
|
git-worktree | File | 2.27 MB | 0755 |
|
git-write-tree | File | 2.27 MB | 0755 |
|