diff options
Diffstat (limited to 'git-rebase--interactive.sh')
-rw-r--r-- | git-rebase--interactive.sh | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index 7e558b068c..2c9c0165b5 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -93,8 +93,17 @@ eval ' GIT_CHERRY_PICK_HELP="$resolvemsg" export GIT_CHERRY_PICK_HELP -comment_char=$(git config --get core.commentchar 2>/dev/null | cut -c1) -: ${comment_char:=#} +comment_char=$(git config --get core.commentchar 2>/dev/null) +case "$comment_char" in +'' | auto) + comment_char="#" + ;; +?) + ;; +*) + comment_char=$(echo "$comment_char" | cut -c1) + ;; +esac warn () { printf '%s\n' "$*" >&2 @@ -416,7 +425,7 @@ update_squash_messages () { if test -f "$squash_msg"; then mv "$squash_msg" "$squash_msg".bak || exit count=$(($(sed -n \ - -e "1s/^$comment_char.*\([0-9][0-9]*\).*/\1/p" \ + -e "1s/^$comment_char[^0-9]*\([0-9][0-9]*\).*/\1/p" \ -e "q" < "$squash_msg".bak)+1)) { printf '%s\n' "$comment_char $(eval_ngettext \ @@ -428,7 +437,8 @@ update_squash_messages () { }' <"$squash_msg".bak } >"$squash_msg" else - commit_message HEAD > "$fixup_msg" || die "$(gettext "Cannot write \$fixup_msg")" + commit_message HEAD >"$fixup_msg" || + die "$(eval_gettext "Cannot write \$fixup_msg")" count=2 { printf '%s\n' "$comment_char $(gettext "This is a combination of 2 commits.")" @@ -1041,7 +1051,7 @@ The possible behaviours are: ignore, warn, error.")" # placed before the commit of the next action checkout_onto - warn "$(gettext "You can fix this with 'git rebase --edit-todo'.")" + warn "$(gettext "You can fix this with 'git rebase --edit-todo' and then run 'git rebase --continue'.")" die "$(gettext "Or you can abort the rebase with 'git rebase --abort'.")" fi } @@ -1059,6 +1069,10 @@ git_rebase__interactive () { case "$action" in continue) + if test ! -d "$rewritten" + then + exec git rebase--helper ${force_rebase:+--no-ff} --continue + fi # do we have anything to commit? if git diff-index --cached --quiet HEAD -- then @@ -1082,7 +1096,7 @@ If they are meant to go into a new commit, run: git commit \$gpg_sign_opt_quoted -In both case, once you're done, continue with: +In both cases, once you're done, continue with: git rebase --continue ")" @@ -1118,6 +1132,10 @@ first and then run 'git rebase --continue' again.")" skip) git rerere clear + if test ! -d "$rewritten" + then + exec git rebase--helper ${force_rebase:+--no-ff} --continue + fi do_rest return 0 ;; @@ -1141,9 +1159,6 @@ To continue rebase after editing, run: ;; esac -git var GIT_COMMITTER_IDENT >/dev/null || - die "$(gettext "You need to set your committer info first")" - comment_for_reflog start if test ! -z "$switch_to" @@ -1307,6 +1322,11 @@ expand_todo_ids test -d "$rewritten" || test -n "$force_rebase" || skip_unnecessary_picks checkout_onto +if test -z "$rebase_root" && test ! -d "$rewritten" +then + require_clean_work_tree "rebase" + exec git rebase--helper ${force_rebase:+--no-ff} --continue +fi do_rest } |