Merge branch 'lf/echo-n-is-not-portable'
authorJunio C Hamano <gitster@pobox.com>
Thu, 1 Aug 2013 18:52:43 +0000 (11:52 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 1 Aug 2013 18:52:43 +0000 (11:52 -0700)
* lf/echo-n-is-not-portable:
Avoid using `echo -n` anywhere

1  2 
contrib/subtree/git-subtree.sh
t/perf/perf-lib.sh
index 51ae932e5edc54db32fca93e8f6f8aca1bea32f4,2b217675af58f7e225e8efad48e0391f8efe3f88..7d7af03274ee0759c9e915a6ea7b52ecce65cf55
@@@ -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 c61d5351e1ff0b1b4431eb28553d0d882ebe7451,eab66d7c9bb5759136184cf8d72f4e1fd82a0ade..f4eecaa17110c2974cfdedab90db4604b6923443
@@@ -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"
                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
                        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
                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