Re: [PATCH v2 1/1] commit: display advice hints when commit fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric Sunshine <sunshine@xxxxxxxxxxxxxx> writes:

> On Thu, Dec 19, 2019 at 2:22 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>> In any case, here is what I tentatively have in my tree (with heavy
>> rewrite to the proposed log message).
>>
>> +test_expect_success 'commit without staging files fails and displays hints' '
>> +       echo "initial" >>file &&
>
> The use of '>>' here rather than '>' feels wrong, especially when
> "initial" is used for both the file body and the commit message,
> causing a reader of the test to wonder if this test somehow depends
> upon earlier tests.

Yeah, makes sense.  This was verbatim from v1 but I think starting
the file from scratch like you suggest makes it clearer what is
going on.


>
>> +       git add file &&
>> +       git commit -m initial &&
>> +       echo "changes" >>file &&
>> +       test_must_fail git commit -m update >actual &&
>> +       test_i18ngrep "no changes added to commit (use \"git add\" and/or \"git commit -a\")" actual
>> +'



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux