{"thread":{"id":"19036","subject":"[PATCH 2/3] bisect: use \"git rev-parse --sq-quote\" instead of a custom \"sq\" function","startedAt":"2009-04-24T06:29:00Z","lastAt":"2009-04-24T06:29:00Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"112161","messageId":"20090424062902.3705.76155.chriscool@tuxfamily.org","threadId":"19036","inReplyTo":null,"subject":"[PATCH 2/3] bisect: use \"git rev-parse --sq-quote\" instead of a custom \"sq\" function","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-04-24T06:29:00Z","receivedAt":"2009-04-24T06:29:00Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"As the \"sq\" function was the only place using Perl in \"git-bisect.sh\",\nthis removes the Perl dependency in this script.\n\nWhile at it, we also remove the sed instruction in the Makefile that\nsubstituted @@PERL@@ with the Perl path in shell scripts, as this is\nnot needed anymore. (It is now only needed in \"git-instaweb.sh\" but\nthis command is dealt with separately in the Makefile.)\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n Makefile      |    1 -\n git-bisect.sh |   16 +++-------------\n 2 files changed, 3 insertions(+), 14 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 5d491ad..bbe15d9 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1247,7 +1247,6 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh\n \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n \tsed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \\\n \t    -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \\\n-\t    -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \\\n \t    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n \t    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \\\n \t    $@.sh >$@+ && \\\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex e1f300b..786b7b9 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -33,16 +33,6 @@ require_work_tree\n _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'\n _x40=\"$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40\"\n \n-sq() {\n-\t@@PERL@@ -e '\n-\t\tfor (@ARGV) {\n-\t\t\ts/'\\''/'\\'\\\\\\\\\\'\\''/g;\n-\t\t\tprint \" '\\''$_'\\''\";\n-\t\t}\n-\t\tprint \"\\n\";\n-\t' \"$@\"\n-}\n-\n bisect_autostart() {\n \ttest -s \"$GIT_DIR/BISECT_START\" || {\n \t\techo >&2 'You need to start by \"git bisect start\"'\n@@ -107,7 +97,7 @@ bisect_start() {\n \tfor arg; do\n \t    case \"$arg\" in --) has_double_dash=1; break ;; esac\n \tdone\n-\torig_args=$(sq \"$@\")\n+\torig_args=$(git rev-parse --sq-quote \"$@\")\n \tbad_seen=0\n \teval=''\n \twhile [ $# -gt 0 ]; do\n@@ -147,7 +137,7 @@ bisect_start() {\n \t# Write new start state.\n \t#\n \techo \"$start_head\" >\"$GIT_DIR/BISECT_START\" &&\n-\tsq \"$@\" >\"$GIT_DIR/BISECT_NAMES\" &&\n+\tgit rev-parse --sq-quote \"$@\" >\"$GIT_DIR/BISECT_NAMES\" &&\n \teval \"$eval\" &&\n \techo \"git bisect start$orig_args\" >>\"$GIT_DIR/BISECT_LOG\" || exit\n \t#\n@@ -199,7 +189,7 @@ bisect_skip() {\n             *..*)\n                 revs=$(git rev-list \"$arg\") || die \"Bad rev input: $arg\" ;;\n             *)\n-                revs=$(sq \"$arg\") ;;\n+                revs=$(git rev-parse --sq-quote \"$arg\") ;;\n \t    esac\n             all=\"$all $revs\"\n         done\n-- \n1.6.3.rc1.112.g17e25\n"}]}