From: Junio C Hamano <gitster@pobox•com>
To: Johannes Schindelin <johannes.schindelin@gmx•de>
Cc: git@vger•kernel.org, "Michael Blume" <blume.mike@gmail•com>,
"Ramsay Jones" <ramsay@ramsayjones•plus.com>,
"Torsten Bögershausen" <tboegi@web•de>
Subject: Re: [PATCH] t0060: loosen overly strict expectations
Date: Thu, 14 Jan 2016 09:33:12 -0800 [thread overview]
Message-ID: <xmqqziw8jcbr.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <eccf149d9557fd9afb591d9411ecb0b3460c9eb0.1452754049.git.johannes.schindelin@gmx.de> (Johannes Schindelin's message of "Thu, 14 Jan 2016 07:48:27 +0100 (CET)")
Johannes Schindelin <johannes.schindelin@gmx•de> writes:
> The dirname() tests file were developed and tested on only the five
> platforms available to the developer at the time, namely: Linux (both 32
> and 64bit), Windows XP 32-bit (MSVC), MinGW 32-bit and Cygwin 32-bit.
>
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/basename.html
> (i.e. the POSIX spec) says, in part:
>
> If the string pointed to by path consists entirely of the '/'
> character, basename() shall return a pointer to the string "/".
> If the string pointed to by path is exactly "//", it is
> implementation-defined whether "/" or "//" is returned.
>
> The thinking behind testing precise, OS-dependent output values was to
> document that different setups produce different values. However, as the
> test failures on MacOSX illustrated eloquently: hardcoding pretty much each
> and every setup's expectations is pretty fragile.
>
> This is not limited to the "//" vs "/" case, of course, other inputs are
> also allowed to produce multiple outpus by the POSIX specs.
>
> So let's just test for all allowed values and be done with it. This still
> documents that Git cannot rely on one particular output value in those
> cases, so the intention of the original tests is still met.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx•de>
> ---
Sounds sensible. Thanks.
This is not a problem with this patch, but the resulting
basename_data[] array seems to test "C:/usr" going to "usr" twice
under _MSC_VER or __MINGW32__.
Also...
> -#if defined(__MINGW32__)
> - /* the following is clearly wrong ... */
> - { "C:", "." },
> -#endif
> -
> -#if defined(_MSC_VER)
> - { "C:", "C:." },
> -#endif
> -
> -#endif
> + { "C:", "C:.", "." },
> #endif
"C:" is still allowed to go to "."; is it still "clearly wrong",
or do we have a reason why we think it is not wrong at all?
I think the comment was written by Ramsay and also suspect that you
did not specifically agree or disagree with that particular
decision, so I'd understand if you do not have a strong opinion
either way, but I'd like to hear from Ramsay. Perhaps earlier we
thought it was clearly wrong but we no longer do?
next prev parent reply other threads:[~2016-01-14 17:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-14 6:48 [PATCH] t0060: loosen overly strict expectations Johannes Schindelin
2016-01-14 17:33 ` Junio C Hamano [this message]
2016-01-14 18:13 ` Ramsay Jones
2016-01-14 22:14 ` Johannes Sixt
2016-01-15 0:46 ` Ramsay Jones
2016-01-15 6:34 ` Johannes Schindelin
2016-01-15 14:53 ` Ramsay Jones
2016-01-15 6:54 ` Johannes Sixt
2016-01-15 14:55 ` Ramsay Jones
2016-01-14 18:52 ` Eric Sunshine
2016-01-15 6:35 ` Johannes Schindelin
2016-01-15 17:26 ` Junio C Hamano
2016-01-19 9:40 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqziw8jcbr.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=blume.mike@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=johannes.schindelin@gmx$(echo .)de \
--cc=ramsay@ramsayjones$(echo .)plus.com \
--cc=tboegi@web$(echo .)de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox