On Fri, Dec 20, 2019 at 1:21 PM Junio C Hamano <gitster@xxxxxxxxx> wrote: > Eric Sunshine <sunshine@xxxxxxxxxxxxxx> writes: > > anomalous behavior is still present. It would be helpful, therefore, > > to mention such an implementation by name: > > > > ...some 'ls' implementations, such as on FreeBSD, include... > > > If we _were_ to add an in-code comment, we may want to say something > like > > # Do not replace this with "cd "$1" && ls", as FreeBSD "ls" > # enables "-A" when run by root without being told, and ends > # up including ".git" etc. in its output. > > to warn future developers against improving and/or cleaning up. I would find this comment more helpful than the existing one since it spells out the issue precisely. A minor tweak: # Do not replace this with "cd "$1" && ls", as FreeBSD "ls" # enables "-A" by default when run by root, and ends up # including ".git" etc. in its output. > Not that we encourage running our tests as root, though. I am > slightly worried that the above phrasing might be taken as such. I'm not sure we really need to spell it out, but something like this might allay that concern: # Do not replace this with "cd "$1" && ls", as FreeBSD "ls" # enables "-A" by default when run by root, and ends up # including ".git" etc. in its output. (Note, though, that # running the test suite as root is generally not # recommended.)