{"thread":{"id":"41185","subject":"[PATCH/RFC] t0060: basename(\"//\") is implementation defined","startedAt":"2016-01-13T20:56:01Z","lastAt":"2016-01-14T11:47:43Z","messageCount":4,"participants":["tboegi@web.de","Junio C Hamano","Johannes Schindelin","Torsten Bögershausen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"275975","messageId":"1452718561-32226-1-git-send-email-tboegi@web.de","threadId":"41185","inReplyTo":null,"subject":"[PATCH/RFC] t0060: basename(\"//\") is implementation defined","fromName":"","fromEmail":"tboegi@web.de","sentAt":"2016-01-13T20:56:01Z","receivedAt":"2016-01-13T20:56:01Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"From: Torsten Bögershausen <tboegi@web.de>\n\nFrom\nhttp://pubs.opengroup.org/onlinepubs/9699919799/functions/basename.html\nbasename(\"//\") may return either \"//\" or \"/\".\n\nLinux returns \"/\", some systems like Mac OS X return \"//\".\nSkip the test unless NO_LIBGEN_H is set and gitbasename() from\ncompat/basename is used.\n\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\nMy version of a hot fix\n test-path-utils.c | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/test-path-utils.c b/test-path-utils.c\nindex 4ab68ac..db0bb39 100644\n--- a/test-path-utils.c\n+++ b/test-path-utils.c\n@@ -142,7 +142,9 @@ static struct test_data dirname_data[] = {\n \t{ \".\",               \".\"      },\n \t{ \"..\",              \".\"      },\n \t{ \"/\",               \"/\"      },\n+#if defined(NO_LIBGEN_H)\n \t{ \"//\",              \"//\"     },\n+#endif\n #if defined(__CYGWIN__) && !defined(NO_LIBGEN_H)\n \t{ \"///\",             \"//\"     },\n \t{ \"////\",            \"//\"     },\n-- \n2.7.0.278.g9379adb.dirty\n"},{"id":"275977","messageId":"xmqqegdlmb7f.fsf@gitster.mtv.corp.google.com","threadId":"41185","inReplyTo":"1452718561-32226-1-git-send-email-tboegi@web.de","subject":"Re: [PATCH/RFC] t0060: basename(\"//\") is implementation defined","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-01-13T21:16:52Z","receivedAt":"2016-01-13T21:16:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"tboegi@web.de writes:\n\n> From: Torsten Bögershausen <tboegi@web.de>\n>\n> From\n> http://pubs.opengroup.org/onlinepubs/9699919799/functions/basename.html\n> basename(\"//\") may return either \"//\" or \"/\".\n>\n> Linux returns \"/\", some systems like Mac OS X return \"//\".\n> Skip the test unless NO_LIBGEN_H is set and gitbasename() from\n> compat/basename is used.\n>\n> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n> ---\n> My version of a hot fix\n>  test-path-utils.c | 2 ++\n>  1 file changed, 2 insertions(+)\n\nThanks.  Ramsay gave a nice analysis at\n\n  http://thread.gmane.org/gmane.comp.version-control.git/283928\n\nand Dscho already is working on it, IIUC, in a slightly different\ndirection.\n\n> diff --git a/test-path-utils.c b/test-path-utils.c\n> index 4ab68ac..db0bb39 100644\n> --- a/test-path-utils.c\n> +++ b/test-path-utils.c\n> @@ -142,7 +142,9 @@ static struct test_data dirname_data[] = {\n>  \t{ \".\",               \".\"      },\n>  \t{ \"..\",              \".\"      },\n>  \t{ \"/\",               \"/\"      },\n> +#if defined(NO_LIBGEN_H)\n>  \t{ \"//\",              \"//\"     },\n> +#endif\n>  #if defined(__CYGWIN__) && !defined(NO_LIBGEN_H)\n>  \t{ \"///\",             \"//\"     },\n>  \t{ \"////\",            \"//\"     },\n"},{"id":"276009","messageId":"alpine.DEB.2.20.1601140758420.2964@virtualbox","threadId":"41185","inReplyTo":"1452718561-32226-1-git-send-email-tboegi@web.de","subject":"Re: [PATCH/RFC] t0060: basename(\"//\") is implementation defined","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-14T07:00:24Z","receivedAt":"2016-01-14T07:00:24Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Torsten,\n\nOn Wed, 13 Jan 2016, tboegi@web.de wrote:\n\n> diff --git a/test-path-utils.c b/test-path-utils.c\n> index 4ab68ac..db0bb39 100644\n> --- a/test-path-utils.c\n> +++ b/test-path-utils.c\n> @@ -142,7 +142,9 @@ static struct test_data dirname_data[] = {\n>  \t{ \".\",               \".\"      },\n>  \t{ \"..\",              \".\"      },\n>  \t{ \"/\",               \"/\"      },\n> +#if defined(NO_LIBGEN_H)\n>  \t{ \"//\",              \"//\"     },\n> +#endif\n\nThis would miss faulty implementations that return completely bogus\noutputs for the \"//\" input. Not very likely, I agree, but the entire\nintention of this regression test is to verify that Git's expectations are\nmet (and to document those expectations).\n\nI hope you like the alternative patch I just sent out.\n\nCiao,\nDscho\n"},{"id":"276019","messageId":"56978ADF.5040401@web.de","threadId":"41185","inReplyTo":"alpine.DEB.2.20.1601140758420.2964@virtualbox","subject":"Re: [PATCH/RFC] t0060: basename(\"//\") is implementation defined","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-01-14T11:47:43Z","receivedAt":"2016-01-14T11:47:43Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 01/14/2016 08:00 AM, Johannes Schindelin wrote:\n> Hi Torsten,\n>\n> On Wed, 13 Jan 2016, tboegi@web.de wrote:\n>\n>> diff --git a/test-path-utils.c b/test-path-utils.c\n>> index 4ab68ac..db0bb39 100644\n>> --- a/test-path-utils.c\n>> +++ b/test-path-utils.c\n>> @@ -142,7 +142,9 @@ static struct test_data dirname_data[] = {\n>>   \t{ \".\",               \".\"      },\n>>   \t{ \"..\",              \".\"      },\n>>   \t{ \"/\",               \"/\"      },\n>> +#if defined(NO_LIBGEN_H)\n>>   \t{ \"//\",              \"//\"     },\n>> +#endif\n> This would miss faulty implementations that return completely bogus\n> outputs for the \"//\" input. Not very likely, I agree, but the entire\n> intention of this regression test is to verify that Git's expectations are\n> met (and to document those expectations).\n>\n> I hope you like the alternative patch I just sent out.\nYepp, looks good. Thanks for the work.\n"}]}