Re: [PATCH 1/3] t3301: tolerate minor notes-related presentation changes

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

 



On Mon, Aug 30, 2021 at 1:09 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Eric Sunshine <sunshine@xxxxxxxxxxxxxx> writes:
> > These tests care about whether intended notes-related functionality
> > occurred and that `git log` presents the notes in the expected fashion
> > (or, in some cases, that `git log` suppresses the notes). However, the
> > tests hard-code the precise indentation of notes by the default `git
> > log` output, which makes them somewhat brittle since they won't be able
> > to tolerate even minor changes to the presentation. Make the tests a bit
> > more robust by ignoring indentation.
>
> Isn't this losing too much information?  If we lose all, or gain
> random number of, leading whitespaces, the test won't notice.

That was the idea. The precise amount of indentation -- whether four
spaces or one TAB or whatever -- seems pretty much immaterial in the
wide view [1], and it is not inconceivable that the exact amount of
indentation might change in the future, thus this future-proofs the
tests against minor indentation changes.

However, as mentioned in my response to Ævar, I wavered quite a bit on
whether or not to make this change since, although the justification
of "future-proofing" the tests isn't exactly hand-wavy, we don't need
the change either. It may be a case of YAGNI. So, as I also mentioned
in that response, I don't mind at all dropping this patch and going
with Ævar's version.

[1]: mechanical extraction aside...



[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