From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Sixt Subject: Re: [PATCHv4] rebase [-i --exec | -ix] ... Date: Tue, 12 Jun 2012 20:55:43 +0200 Message-ID: <4FD790AF.5070108@kdbg.org> References: <1339167235-2009-2-git-send-email-Lucien.Kong@ensimag.imag.fr> <1339325076-474-1-git-send-email-Lucien.Kong@ensimag.imag.fr> <4FD48B70.5080600@kdbg.org> <7vpq9598yb.fsf@alter.siamese.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Lucien Kong , git@vger.kernel.org, tboegi@web.de, Valentin Duperray , Franck Jonas , Thomas Nguy , Huynh Khoi Nguyen Nguyen , Matthieu Moy To: Junio C Hamano X-From: git-owner@vger.kernel.org Tue Jun 12 20:56:09 2012 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 1SeWFw-0008PA-At for gcvg-git-2@plane.gmane.org; Tue, 12 Jun 2012 20:55:56 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753254Ab2FLSzr (ORCPT ); Tue, 12 Jun 2012 14:55:47 -0400 Received: from bsmtp.bon.at ([213.33.87.14]:47479 "EHLO bsmtp.bon.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751997Ab2FLSzq (ORCPT ); Tue, 12 Jun 2012 14:55:46 -0400 Received: from dx.sixt.local (unknown [93.83.142.38]) by bsmtp.bon.at (Postfix) with ESMTP id 4280913005B; Tue, 12 Jun 2012 20:51:15 +0200 (CEST) Received: from [IPv6:::1] (localhost [IPv6:::1]) by dx.sixt.local (Postfix) with ESMTP id 6E0AB19F673; Tue, 12 Jun 2012 20:55:43 +0200 (CEST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120421 Thunderbird/12.0 In-Reply-To: <7vpq9598yb.fsf@alter.siamese.dyndns.org> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Am 11.06.2012 17:14, schrieb Junio C Hamano: > Johannes Sixt writes: > >> Am 10.06.2012 12:44, schrieb Lucien Kong: >>> +test_expect_success 'rebase -i --exec without shows error message and usage' ' >>> + git reset --hard execute && >>> + test_must_fail git rebase -i --exec 2>actual && >>> + sed '1d' actual >tmp && >>> + mv tmp actual && >>> + test_must_fail git rebase -h >expected && >>> + test_cmp expected actual && >>> + git checkout master >>> +' >> >> IMO, it is more important to check that the error message is present >> rather than whether the usage blurb is correct. But since the error is >> generated by the option parsing machinery, it is probably sufficient to >> check *only* for failure, and don't verify the output at all. I changed my mind. If option parsing regresses in such a way that --exec suddenly works without command, then the 'test_must_fail git rebase ...' could pass because there is a failure much later in the rebase process, which we would not detect if we do not check the output. It is therefore good to check whether the expected failure happens during option parsing. Checking the usage blurb rather than the error message even has advantages: it is immune to changes of the error messages and to i18n poisoning. In this light, the version you have queued is fine. -- Hannes