From: Junio C Hamano Date: Thu, 1 Aug 2013 18:52:43 +0000 (-0700) Subject: Merge branch 'lf/echo-n-is-not-portable' X-Git-Tag: v1.8.4-rc1~4 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/a5203a3f044ced7904800f3f233451474c1d5120?hp=-c Merge branch 'lf/echo-n-is-not-portable' * lf/echo-n-is-not-portable: Avoid using `echo -n` anywhere --- a5203a3f044ced7904800f3f233451474c1d5120 diff --combined contrib/subtree/git-subtree.sh index 51ae932e5e,2b217675af..7d7af03274 --- a/contrib/subtree/git-subtree.sh +++ b/contrib/subtree/git-subtree.sh @@@ -1,4 -1,4 +1,4 @@@ -#!/bin/bash +#!/bin/sh # # git-subtree.sh: split/join git repositories in subdirectories of this one # @@@ -311,7 -311,7 +311,7 @@@ copy_commit( GIT_COMMITTER_NAME \ GIT_COMMITTER_EMAIL \ GIT_COMMITTER_DATE - (echo -n "$annotate"; cat ) | + (printf "%s" "$annotate"; cat ) | git commit-tree "$2" $3 # reads the rest of stdin ) || die "Can't copy commit $1" } @@@ -715,8 -715,7 +715,8 @@@ cmd_push( repository=$1 refspec=$2 echo "git push using: " $repository $refspec - git push $repository $(git subtree split --prefix=$prefix):refs/heads/$refspec + localrev=$(git subtree split --prefix="$prefix") || die + git push $repository $localrev:refs/heads/$refspec else die "'$dir' must already exist. Try 'git subtree add'." fi diff --combined t/perf/perf-lib.sh index c61d5351e1,eab66d7c9b..f4eecaa171 --- a/t/perf/perf-lib.sh +++ b/t/perf/perf-lib.sh @@@ -150,7 -150,6 +150,7 @@@ exit $ret' >&3 2>& test_perf () { + test_start_ test "$#" = 3 && { test_prereq=$1; shift; } || test_prereq= test "$#" = 2 || error "bug in the test script: not 2 or 3 parameters to test-expect-success" @@@ -161,7 -160,7 +161,7 @@@ echo "$test_count" >>"$perf_results_dir"/$base.subtests echo "$1" >"$perf_results_dir"/$base.$test_count.descr if test -z "$verbose"; then - echo -n "perf $test_count - $1:" + printf "%s" "perf $test_count - $1:" else echo "perf $test_count - $1:" fi @@@ -170,7 -169,7 +170,7 @@@ if test_run_perf_ "$2" then if test -z "$verbose"; then - echo -n " $i" + printf " %s" "$i" else echo "* timing run $i/$GIT_PERF_REPEAT_COUNT:" fi @@@ -188,7 -187,7 +188,7 @@@ base="$perf_results_dir"/"$perf_results_prefix$(basename "$0" .sh)"."$test_count" "$TEST_DIRECTORY"/perf/min_time.perl test_time.* >"$base".times fi - echo >&3 "" + test_finish_ } # We extend test_done to print timings at the end (./run disables this