git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 3/3] bisect: check for mandatory argument of 'bisect replay'

From
Christian Couder <christian.couder@gmail.com>
Date
Oct 14, 2010, 07:55 UTC
Message-ID
<AANLkTi=HCHy0q4atzVYUGO0hQ3FBigZcFDsFLv9iZ=h-@mail.gmail.com>
In-Reply-To
<7viq16m0tk.fsf@alter.siamese.dyndns.org>
On Wed, Oct 13, 2010 at 7:58 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 33 quoted lines
> Christian Couder <chriscool@tuxfamily.org> writes:
>
>>> >  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 logfile."
>>>      test -r "$1" || die "cannot read $1 for replaying"
>>>      bisect_reset
>>>      while read git bisect command rev
>>
>> I mean:
>>
>> bisect_replay () {
>> +     test "$#" -lt 1 && die "No logfile given"
>> +     test "$#" -gt 1 && die "Too many argument. Please give only one logfile."
>>       test -r "$1" || die "cannot read $1 for replaying"
>>       bisect_reset
>>       while read git bisect command rev
>
> That suggests that the original patch is buggy as well, in that it says
> "No logfile given" when it gets two.
>
> How about checking with 1 and saying "Give me only one logfile" and be
> done with it?
Yeah or: "Give me exactly one logfile as argument"

Best regards, Christian.

Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 7 of 8 in “bisect: improve error message of 'bisect log' while not bisecting”
  1. 1/3 bisect: improve error message of 'bisect log' while not bisectingSZEDER Gábor, Oct 10, 2010
  2. 2/3 bisect: improve error msg of 'bisect reset' when original HEAD is deletedSZEDER Gábor, Oct 10, 2010
  3. 3/3 bisect: check for mandatory argument of 'bisect replay'SZEDER Gábor, Oct 10, 2010
  4. Christian CouderOct 12, 2010
  5. Christian CouderOct 12, 2010
  6. Junio C HamanoOct 13, 2010
  7. Christian CouderOct 14, 2010
  8. Ævar Arnfjörð BjarmasonOct 11, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.