From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Schindelin Subject: [PATCH 2/2] t3404: be resilient against running with the -x flag Date: Tue, 10 May 2016 16:07:22 +0200 (CEST) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Cc: git@vger.kernel.org To: Junio C Hamano X-From: git-owner@vger.kernel.org Tue May 10 16:07:36 2016 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b08Jz-0006fi-5Y for gcvg-git-2@plane.gmane.org; Tue, 10 May 2016 16:07:35 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752239AbcEJOHb (ORCPT ); Tue, 10 May 2016 10:07:31 -0400 Received: from mout.gmx.net ([212.227.17.22]:58842 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751054AbcEJOH3 (ORCPT ); Tue, 10 May 2016 10:07:29 -0400 Received: from virtualbox ([37.24.143.84]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0MWTSA-1b7Bc93Ksk-00XevL; Tue, 10 May 2016 16:07:24 +0200 X-X-Sender: virtualbox@virtualbox In-Reply-To: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) X-Provags-ID: V03:K0:2jsp+UQTpgJEA/2XWQv1QaqCLkN3p8KBBhMpK6Q5bqJBx8593mg OCscgJ4ofWtNvy/QUWV50Tq5PkS54bpJSrANmm6EyIsxCOTMeZ4wjjJT6ilbnsTTl2JZLPz qGgVaDJfODtl2keczttq4weBmJHB8Iv80rTrXscFX0utkBsa+wJudzx+EO03ni/WftVDABz gDm1yQyoUzQFa8VR5nTbw== X-UI-Out-Filterresults: notjunk:1;V01:K0:90xsIHr2NFU=:7aiSGAvVR4Q5QZCJifYnBv C98/pcyy6HK6kwhGbXbtiiinYYHHZ1mbc+vFwNsRt4eusgfsjnCXzk2BIKZpnks8xLYEXZ15Q 4KWhDJRw8vphuNWbHa3b1EkxZ7jBtuGXlJQESMaTv+QcBSMae0tWkgg7hu8IEBuEc4dBRpQ0j OLC1ZecT1SIxiwKip8ejVPrG5h78OtIaM4BGN/dbzX7qR6tm1aQnrZUt1hrR/k2cH6qZqxlRW J7lF2xJxAC9EgQTYbtylEdWJJXqpiFsBUHer3qWlNGUJXzl08kfYSDcSgSK3GgrT8DfWQn3pN xAXZ3o0rco1Wfhqgs7YhjGLD36rUvrrtqnxmRxPeD+i7SgtxDId+HBz+njpeCHZGkdKrOvApG ZAQ/HtlU3+BsWblslbeeXice5OOZO2ihHNIU63joo/5hYJQdh3n/xmSzoaQHO4o4Py8NKoyNB hmiKhnR7/rZkoFUBWVY/7jq89MLU4mNOkKS/zcTaO82VAIJctbU7+sGHLS7fx7lnYm4UhCaxt 3QaTOWRO8PUhSvkh5+d5eYujIz8ccMvPcJxMl30WIT8q4D36EA4e57cNQTfl55Uo8hHnIL147 hieG+Yp1yAv4VY23Obi1BYWO4GqukhelYIubgbEgog5dVCQ+XC3AWHdn+0VlR3b84StKq5Thv JKrUD/5ieW5/GmgIdEZHIWFZDls1QuY+gcseWLCDxUs+QcPod8zWjreOH0vUQ3SGlQILP8apv SSS2Qi8mwC0oWM8nMeXTNQJDvWbycunRJm5Yhmq+m0pWnF3PSjY7RrL6Vz6YIJ39SOCsHup8 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: The -x flag (trace commands) is a priceless tool when hunting down bugs that trigger test failures. It is a worthless tool if the -x flag *itself* triggers test failures. So let's change the offending tests so that they are a bit less stringent and do not stumble over the "+..." lines generated by the -x flag. Signed-off-by: Johannes Schindelin --- t/t3404-rebase-interactive.sh | 67 ++++++++++--------------------------------- 1 file changed, 15 insertions(+), 52 deletions(-) diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index 66348f1..25f1118 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -882,7 +882,8 @@ test_expect_success 'rebase -i --exec without ' ' git reset --hard execute && set_fake_editor && test_must_fail git rebase -i --exec 2>tmp && - sed -e "1d" tmp >actual && + sed -e "/option .exec. requires a value/d" -e '/^+/d' \ + tmp >actual && test_must_fail git rebase -h >expected && test_cmp expected actual && git checkout master @@ -1149,10 +1150,6 @@ test_expect_success 'drop' ' test A = $(git cat-file commit HEAD^^ | sed -ne \$p) ' -cat >expect <actual && test D = $(git cat-file commit HEAD | sed -ne \$p) && - test_cmp expect actual + test_i18ngrep \ + "Successfully rebased and updated refs/heads/missing-commit." \ + actual ' -cat >expect <actual && - test_cmp expect actual && + test_i18ngrep "Warning: some commits may have been dropped" actual && + test_i18ngrep "^ - $line" actual && test D = $(git cat-file commit HEAD | sed -ne \$p) ' -cat >expect <actual && - test_cmp expect actual && + test_i18ngrep "^ - $line1" actual && + test_i18ngrep "^ - $line2" actual && cp .git/rebase-merge/git-rebase-todo.backup \ .git/rebase-merge/git-rebase-todo && FAKE_LINES="1 2 drop 3 4 drop 5" \ @@ -1215,20 +1193,13 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = error' ' test B = $(git cat-file commit HEAD^ | sed -ne \$p) ' -cat >expect <actual && - test_cmp expect actual && + test_i18ngrep "^$line" actual && FAKE_LINES="1 2 3 drop 4 5" git rebase --edit-todo && git rebase --continue && test E = $(git cat-file commit HEAD | sed -ne \$p) && @@ -1250,20 +1221,12 @@ test_expect_success 'tabs and spaces are accepted in the todolist' ' test E = $(git cat-file commit HEAD | sed -ne \$p) ' -cat >expect <actual && - test_cmp expect actual && + test_i18ngrep "^ - edit XXXXXXX False commit" actual && FAKE_LINES="1 2 4 5 6" git rebase --edit-todo && git rebase --continue && test E = $(git cat-file commit HEAD | sed -ne \$p) -- 2.8.2.463.g99156ee