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

From
Eric Sunshine <hidden>
Date
2021-08-30 18:16:34
Reply to
Junio C Hamano, 2021-08-30
On Mon, Aug 30, 2021 at 1:09 PM Junio C Hamano [off-list ref] wrote:
Eric Sunshine [off-list ref] writes:
quoted
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...
Thread (2 messages) 2 messages, 2 authors, 2021-08-30
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help