From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Couder Subject: Re: [PATCH 3/3] bisect: check for mandatory argument of 'bisect replay' Date: Tue, 12 Oct 2010 04:35:11 +0200 Message-ID: <201010120435.11903.chriscool@tuxfamily.org> References: <1286747338-8521-1-git-send-email-szeder@ira.uka.de> <1286747338-8521-3-git-send-email-szeder@ira.uka.de> Mime-Version: 1.0 Content-Type: Text/Plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Junio C Hamano , git@vger.kernel.org To: SZEDER =?utf-8?q?G=C3=A1bor?= X-From: git-owner@vger.kernel.org Tue Oct 12 04:45:36 2010 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P5Urs-0001kB-8a for gcvg-git-2@lo.gmane.org; Tue, 12 Oct 2010 04:45:32 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754110Ab0JLCfW convert rfc822-to-quoted-printable (ORCPT ); Mon, 11 Oct 2010 22:35:22 -0400 Received: from smtp3-g21.free.fr ([212.27.42.3]:42478 "EHLO smtp3-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752121Ab0JLCfV convert rfc822-to-8bit (ORCPT ); Mon, 11 Oct 2010 22:35:21 -0400 Received: from style.localnet (unknown [82.243.130.161]) by smtp3-g21.free.fr (Postfix) with ESMTP id B90BAA611A; Tue, 12 Oct 2010 04:35:13 +0200 (CEST) User-Agent: KMail/1.13.2 (Linux/2.6.32-24-generic; KDE/4.4.2; x86_64; ; ) In-Reply-To: <1286747338-8521-3-git-send-email-szeder@ira.uka.de> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Sunday 10 October 2010 23:48:58 SZEDER G=C3=A1bor wrote: > 'git bisect replay' has a mandatory logfile argument, but the current > implementation doesn't check whether the user has specified one. Whe= n > the user omits the logfile argument, this leads to the following > unhelpful error message: >=20 > cannot read for replaying >=20 > So, check for the mandatory argument first, and provide a more > meaningful error message when it is omitted. >=20 > Signed-off-by: SZEDER G=C3=A1bor > --- > git-bisect.sh | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) >=20 > diff --git a/git-bisect.sh b/git-bisect.sh > index 68fcff6..c21e33c 100755 > --- a/git-bisect.sh > +++ b/git-bisect.sh > @@ -343,6 +343,7 @@ bisect_clean_state() { > } >=20 > bisect_replay () { > + test "$#" -eq 1 || die "No logfile given" > test -r "$1" || die "cannot read $1 for replaying" > bisect_reset > while read git bisect command rev While at it perhaps you could do something like: bisect_replay () { + test "$#" -lt 1 || die "No logfile given" + test "$#" -gt 1 || die "Too many argument. Please give only one logfi= le." test -r "$1" || die "cannot read $1 for replaying" bisect_reset while read git bisect command rev Thanks, Christian.