@matheusbsbs / matheus-bagliano / commits / de52f5a806
Fork 0

bisect: use "git rev-parse --sq-quote" instead of a custom "sq" function

As the "sq" function was the only place using Perl in "git-bisect.sh", this removes the Perl dependency in this script. While at it, we also remove the sed instruction in the Makefile that substituted @@PERL@@ with the Perl path in shell scripts, as this is not needed anymore. (It is now only needed in "git-instaweb.sh" but this command is dealt with separately in the Makefile.) Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Christian Couder committed Apr 24, 2009 at 08:29 UTC de52f5a806f58c6b73b2e24768530213fab5a635
2 files changed +3 -14
Makefile
-1
@@ -1248,7 +1248,6 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
1248 $(QUIET_GEN)$(RM) $@ $@+ && \
1249 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
1250 -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
1251 - -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
1251 -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
1252 -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
1253 $@.sh >$@+ && \
git-bisect.sh
+3 -13
@@ -33,16 +33,6 @@ require_work_tree
33 _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
34 _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
35
36 -sq() {
37 - @@PERL@@ -e '
38 - for (@ARGV) {
39 - s/'\''/'\'\\\\\'\''/g;
40 - print " '\''$_'\''";
41 - }
42 - print "\n";
43 - ' "$@"
44 -}
45 -
36 bisect_autostart() {
37 test -s "$GIT_DIR/BISECT_START" || {
38 echo >&2 'You need to start by "git bisect start"'
@@ -107,7 +97,7 @@ bisect_start() {
97 for arg; do
98 case "$arg" in --) has_double_dash=1; break ;; esac
99 done
110 - orig_args=$(sq "$@")
100 + orig_args=$(git rev-parse --sq-quote "$@")
101 bad_seen=0
102 eval=''
103 while [ $# -gt 0 ]; do
@@ -147,7 +137,7 @@ bisect_start() {
137 # Write new start state.
138 #
139 echo "$start_head" >"$GIT_DIR/BISECT_START" &&
150 - sq "$@" >"$GIT_DIR/BISECT_NAMES" &&
140 + git rev-parse --sq-quote "$@" >"$GIT_DIR/BISECT_NAMES" &&
141 eval "$eval" &&
142 echo "git bisect start$orig_args" >>"$GIT_DIR/BISECT_LOG" || exit
143 #
@@ -199,7 +189,7 @@ bisect_skip() {
189 *..*)
190 revs=$(git rev-list "$arg") || die "Bad rev input: $arg" ;;
191 *)
202 - revs=$(sq "$arg") ;;
192 + revs=$(git rev-parse --sq-quote "$arg") ;;
193 esac
194 all="$all $revs"
195 done