From 3007a78033fec09b97ff1ca816a2d23c292dd956 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 22 Mar 2007 21:05:28 -0400 Subject: t4118: be nice to non-GNU sed Elias Pipping: > I'm on a mac, hence /usr/bin/sed is not gnu sed, which makes > t4118 fail. Signed-off-by: Johannes Schindelin Ack'd-by: Elias Pipping Signed-off-by: Junio C Hamano --- t/t4118-apply-empty-context.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/t4118-apply-empty-context.sh b/t/t4118-apply-empty-context.sh index 690a182003..27cc6f2b88 100755 --- a/t/t4118-apply-empty-context.sh +++ b/t/t4118-apply-empty-context.sh @@ -23,7 +23,8 @@ test_expect_success setup ' cat file2 >file2.orig git add file1 file2 && sed -e "/^B/d" file1 && - sed -e "/^B/d" file2 && + sed -e "/^[BQ]/d" file2 && + echo Q | tr -d "\\012" >>file2 && cat file1 >file1.mods && cat file2 >file2.mods && git diff | -- cgit v1.2.3 From a17c4101003dbadc13d404a5dd5d106de1e57a3a Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Fri, 23 Mar 2007 08:49:59 +0100 Subject: Bisect: implement "git bisect run ..." to automatically bisect. This idea was suggested by Bill Lear (Message-ID: <17920.38942.364466.642979@lisa.zopyra.com>) and I think it is a very good one. This patch adds a new test file for "git bisect run", but there is currently only one basic test. Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- t/t6030-bisect-run.sh | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100755 t/t6030-bisect-run.sh (limited to 't') diff --git a/t/t6030-bisect-run.sh b/t/t6030-bisect-run.sh new file mode 100755 index 0000000000..39c72283b5 --- /dev/null +++ b/t/t6030-bisect-run.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# +# Copyright (c) 2007 Christian Couder +# +test_description='Tests git-bisect run functionality' + +. ./test-lib.sh + +add_line_into_file() +{ + _line=$1 + _file=$2 + + if [ -f "$_file" ]; then + echo "$_line" >> $_file || return $? + MSG="Add <$_line> into <$_file>." + else + echo "$_line" > $_file || return $? + git add $_file || return $? + MSG="Create file <$_file> with <$_line> inside." + fi + + git-commit -m "$MSG" $_file +} + +HASH1= +HASH3= +HASH4= + +test_expect_success \ + 'set up basic repo with 1 file (hello) and 4 commits' \ + 'add_line_into_file "1: Hello World" hello && + add_line_into_file "2: A new day for git" hello && + add_line_into_file "3: Another new day for git" hello && + add_line_into_file "4: Ciao for now" hello && + HASH1=$(git rev-list HEAD | tail -1) && + HASH3=$(git rev-list HEAD | head -2 | tail -1) && + HASH4=$(git rev-list HEAD | head -1)' + +# We want to automatically find the commit that +# introduced "Another" into hello. +test_expect_success \ + 'git bisect run simple case' \ + 'echo "#!/bin/sh" > test_script.sh && + echo "grep Another hello > /dev/null" >> test_script.sh && + echo "test \$? -ne 0" >> test_script.sh && + chmod +x test_script.sh && + git bisect start && + git bisect good $HASH1 && + git bisect bad $HASH4 && + git bisect run ./test_script.sh > my_bisect_log.txt && + grep "$HASH3 is first bad commit" my_bisect_log.txt' + +# +# +test_done + -- cgit v1.2.3