From: Junio C Hamano Date: Tue, 27 Dec 2016 08:11:45 +0000 (-0800) Subject: Merge branch 'va/i18n-even-more' X-Git-Tag: v2.12.0-rc0~97 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/eef32a0653f9b4e90ace46c9f041ff41dbf4e632?ds=sidebyside;hp=-c Merge branch 'va/i18n-even-more' * va/i18n-even-more: i18n: fix misconversion in shell scripts --- eef32a0653f9b4e90ace46c9f041ff41dbf4e632 diff --combined git-rebase--interactive.sh index 41fd374c72,c5806859f0..b0a6f2b7ba --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@@ -93,17 -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 @@@ -130,7 -121,7 +130,7 @@@ mark_action_done () sed -e 1q < "$todo" >> "$done" sed -e 1d < "$todo" >> "$todo".new mv -f "$todo".new "$todo" - new_count=$(git stripspace --strip-comments <"$done" | wc -l) + new_count=$(( $(git stripspace --strip-comments <"$done" | wc -l) )) echo $new_count >"$msgnum" total=$(($new_count + $(git stripspace --strip-comments <"$todo" | wc -l))) echo $total >"$end" @@@ -200,6 -191,7 +200,6 @@@ make_patch () die_with_patch () { echo "$1" > "$state_dir"/stopped-sha make_patch "$1" - git rerere die "$2" } @@@ -221,7 -213,6 +221,7 @@@ Once you are satisfied with your change } die_abort () { + apply_autostash rm -rf "$state_dir" die "$1" } @@@ -413,12 -404,51 +413,12 @@@ pick_one_preserving_merges () this_nth_commit_message () { n=$1 - case "$n" in - 1) gettext "This is the 1st commit message:";; - 2) gettext "This is the 2nd commit message:";; - 3) gettext "This is the 3rd commit message:";; - 4) gettext "This is the 4th commit message:";; - 5) gettext "This is the 5th commit message:";; - 6) gettext "This is the 6th commit message:";; - 7) gettext "This is the 7th commit message:";; - 8) gettext "This is the 8th commit message:";; - 9) gettext "This is the 9th commit message:";; - 10) gettext "This is the 10th commit message:";; - # TRANSLATORS: if the language you are translating into - # doesn't allow you to compose a sentence in this fashion, - # consider translating as if this and the following few strings - # were "This is the commit message ${n}:" - *1[0-9]|*[04-9]) eval_gettext "This is the \${n}th commit message:";; - *1) eval_gettext "This is the \${n}st commit message:";; - *2) eval_gettext "This is the \${n}nd commit message:";; - *3) eval_gettext "This is the \${n}rd commit message:";; - *) eval_gettext "This is the commit message \${n}:";; - esac + eval_gettext "This is the commit message #\${n}:" } + skip_nth_commit_message () { n=$1 - case "$n" in - 1) gettext "The 1st commit message will be skipped:";; - 2) gettext "The 2nd commit message will be skipped:";; - 3) gettext "The 3rd commit message will be skipped:";; - 4) gettext "The 4th commit message will be skipped:";; - 5) gettext "The 5th commit message will be skipped:";; - 6) gettext "The 6th commit message will be skipped:";; - 7) gettext "The 7th commit message will be skipped:";; - 8) gettext "The 8th commit message will be skipped:";; - 9) gettext "The 9th commit message will be skipped:";; - 10) gettext "The 10th commit message will be skipped:";; - # TRANSLATORS: if the language you are translating into - # doesn't allow you to compose a sentence in this fashion, - # consider translating as if this and the following few strings - # were "The commit message ${n} will be skipped:" - *1[0-9]|*[04-9]) eval_gettext "The \${n}th commit message will be skipped:";; - *1) eval_gettext "The \${n}st commit message will be skipped:";; - *2) eval_gettext "The \${n}nd commit message will be skipped:";; - *3) eval_gettext "The \${n}rd commit message will be skipped:";; - *) eval_gettext "The commit message \${n} will be skipped:";; - esac + eval_gettext "The commit message #\${n} will be skipped:" } update_squash_messages () { @@@ -437,7 -467,8 +437,8 @@@ }' <"$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.")" @@@ -1050,7 -1081,7 +1051,7 @@@ The possible behaviours are: ignore, wa # 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 } @@@ -1060,8 -1091,8 +1061,8 @@@ # below were not inside any function, and expected to return # to the function that dot-sourced us. # -# However, FreeBSD /bin/sh misbehaves on such a construct and -# continues to run the statements that follow such a "return". +# 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__interactive () { @@@ -1091,7 -1122,7 +1092,7 @@@ If they are meant to go into a new comm 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 ")" @@@ -1150,6 -1181,9 +1151,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" diff --combined git-sh-setup.sh index 240c7ebcd1,c7b2a95463..378928518b --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@@ -2,6 -2,9 +2,6 @@@ # to set up some variables pointing at the normal git directories and # a few helper shell functions. -# Source git-sh-i18n for gettext support. -. git-sh-i18n - # Having this variable in your environment would break scripts because # you would cause "cd" to be taken to unexpected places. If you # like CDPATH, define it for your interactive shell sessions without @@@ -43,9 -46,6 +43,9 @@@ git_broken_path_fix () # @@BROKEN_PATH_FIX@@ +# Source git-sh-i18n for gettext support. +. "$(git --exec-path)/git-sh-i18n" + die () { die_with_status 1 "$@" } @@@ -163,11 -163,9 +163,11 @@@ git_pager() else GIT_PAGER=cat fi - : ${LESS=-FRX} - : ${LV=-c} - export LESS LV + for vardef in @@PAGER_ENV@@ + do + var=${vardef%%=*} + eval ": \"\${$vardef}\" && export $var" + done eval "$GIT_PAGER" '"$@"' } @@@ -196,14 -194,14 +196,14 @@@ require_work_tree_exists () if test "z$(git rev-parse --is-bare-repository)" != zfalse then program_name=$0 - die "$(gettext "fatal: \$program_name cannot be used without a working tree.")" + die "$(eval_gettext "fatal: \$program_name cannot be used without a working tree.")" fi } require_work_tree () { test "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = true || { program_name=$0 - die "$(gettext "fatal: \$program_name cannot be used without a working tree.")" + die "$(eval_gettext "fatal: \$program_name cannot be used without a working tree.")" } } @@@ -377,7 -375,7 +377,7 @@@ git_dir_init () gettextln "Unable to determine absolute path of git directory" >&2 exit 1 } - : ${GIT_OBJECT_DIRECTORY="$(git rev-parse --git-path objects)"} + : "${GIT_OBJECT_DIRECTORY="$(git rev-parse --git-path objects)"}" } if test -z "$NONGIT_OK"