{"thread":{"id":"44266","subject":"Re: [PATCH] t4014-format-patch: Adjust git_version regex to better handle distro changes to DEF_VER","startedAt":"2016-10-10T03:04:38Z","lastAt":"2016-10-11T20:07:12Z","messageCount":9,"participants":["Josh Triplett","Jeremy Huddleston Sequoia","Jeff King","Junio C Hamano","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"303692","messageId":"E0254A0C-8BEC-4B88-A352-BA075B49BFA7@joshtriplett.org","threadId":"44266","inReplyTo":"20161010025323.9415-1-jeremyhu@apple.com","subject":"Re: [PATCH] t4014-format-patch: Adjust git_version regex to better handle distro changes to DEF_VER","fromName":"Josh Triplett","fromEmail":"josh@joshtriplett.org","sentAt":"2016-10-10T03:04:24Z","receivedAt":"2016-10-10T03:04:38Z","isPatch":true,"sender":{"key":"josh@joshtriplett.org","avatar":"https://avatars.githubusercontent.com/u/162737?v=4"},"body":"On October 9, 2016 7:53:23 PM PDT, Jeremy Huddleston Sequoia <jeremyhu@apple.com> wrote:\n>Regressed-in: 480871e09ed2e5275b4ba16b278681e5a8c122ae\n>Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>\n>CC: Josh Triplett <josh@joshtriplett.org>\n>CC: Junio C Hamano <gitster@pobox.com>\n\nLooks reasonable to me. Didn't realize git versions could have spaces.\nReviewed-by: Josh Triplett <josh@joshtriplett.org>\n\n> t/t4014-format-patch.sh | 2 +-\n> 1 file changed, 1 insertion(+), 1 deletion(-)\n>\n>diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\n>index 8d90a6e..33f6940 100755\n>--- a/t/t4014-format-patch.sh\n>+++ b/t/t4014-format-patch.sh\n>@@ -754,7 +754,7 @@ test_expect_success 'format-patch\n>--ignore-if-in-upstream HEAD' '\n> \tgit format-patch --ignore-if-in-upstream HEAD\n> '\n> \n>-git_version=\"$(git --version | sed \"s/.* //\")\"\n>+git_version=\"$(git --version | sed \"s/git version //\")\"\n> \n> signature() {\n> \tprintf \"%s\\n%s\\n\\n\" \"-- \" \"${1:-$git_version}\"\n\n\n"},{"id":"303693","messageId":"20161010025323.9415-1-jeremyhu@apple.com","threadId":"44266","inReplyTo":null,"subject":"[PATCH] t4014-format-patch: Adjust git_version regex to better handle distro changes to DEF_VER","fromName":"Jeremy Huddleston Sequoia","fromEmail":"jeremyhu@apple.com","sentAt":"2016-10-10T02:53:23Z","receivedAt":"2016-10-10T03:11:46Z","isPatch":true,"sender":{"key":"jeremyhu@apple.com","avatar":"https://avatars.githubusercontent.com/u/1258676?v=4"},"body":"Regressed-in: 480871e09ed2e5275b4ba16b278681e5a8c122ae\nSigned-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>\nCC: Josh Triplett <josh@joshtriplett.org>\nCC: Junio C Hamano <gitster@pobox.com>\n---\n t/t4014-format-patch.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 8d90a6e..33f6940 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -754,7 +754,7 @@ test_expect_success 'format-patch --ignore-if-in-upstream HEAD' '\n \tgit format-patch --ignore-if-in-upstream HEAD\n '\n \n-git_version=\"$(git --version | sed \"s/.* //\")\"\n+git_version=\"$(git --version | sed \"s/git version //\")\"\n \n signature() {\n \tprintf \"%s\\n%s\\n\\n\" \"-- \" \"${1:-$git_version}\"\n-- \n2.10.1 (Apple Git-99)\n\n"},{"id":"303697","messageId":"BC856B6F-B18F-41AF-BE60-973B8CFFC973@apple.com","threadId":"44266","inReplyTo":"E0254A0C-8BEC-4B88-A352-BA075B49BFA7@joshtriplett.org","subject":"Re: [PATCH] t4014-format-patch: Adjust git_version regex to better handle distro changes to DEF_VER","fromName":"Jeremy Huddleston Sequoia","fromEmail":"jeremyhu@apple.com","sentAt":"2016-10-10T04:08:41Z","receivedAt":"2016-10-10T04:09:08Z","isPatch":true,"sender":{"key":"jeremyhu@apple.com","avatar":"https://avatars.githubusercontent.com/u/1258676?v=4"},"body":"\n> On Oct 9, 2016, at 20:04, Josh Triplett <josh@joshtriplett.org> wrote:\n> \n> On October 9, 2016 7:53:23 PM PDT, Jeremy Huddleston Sequoia <jeremyhu@apple.com> wrote:\n>> Regressed-in: 480871e09ed2e5275b4ba16b278681e5a8c122ae\n>> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>\n>> CC: Josh Triplett <josh@joshtriplett.org>\n>> CC: Junio C Hamano <gitster@pobox.com>\n> \n> Looks reasonable to me. Didn't realize git versions could have spaces.\n> Reviewed-by: Josh Triplett <josh@joshtriplett.org>\n\nThanks, Josh.\n\nIf anyone feels strongly that they shouldn't, I'd be happy to change our DEF_VER patch to play nicer.\n\ncf https://github.com/jeremyhu/git/commit/f99905d0752d923e5ec61e14c675a300c6d04284\n\n> \n>> t/t4014-format-patch.sh | 2 +-\n>> 1 file changed, 1 insertion(+), 1 deletion(-)\n>> \n>> diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\n>> index 8d90a6e..33f6940 100755\n>> --- a/t/t4014-format-patch.sh\n>> +++ b/t/t4014-format-patch.sh\n>> @@ -754,7 +754,7 @@ test_expect_success 'format-patch\n>> --ignore-if-in-upstream HEAD' '\n>> \tgit format-patch --ignore-if-in-upstream HEAD\n>> '\n>> \n>> -git_version=\"$(git --version | sed \"s/.* //\")\"\n>> +git_version=\"$(git --version | sed \"s/git version //\")\"\n>> \n>> signature() {\n>> \tprintf \"%s\\n%s\\n\\n\" \"-- \" \"${1:-$git_version}\"\n> \n> \n\n"},{"id":"303721","messageId":"20161010131041.lpdh4a7nol24hsz2@sigill.intra.peff.net","threadId":"44266","inReplyTo":"20161010025323.9415-1-jeremyhu@apple.com","subject":"Re: [PATCH] t4014-format-patch: Adjust git_version regex to better handle distro changes to DEF_VER","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-10-10T13:10:41Z","receivedAt":"2016-10-10T13:11:02Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Oct 09, 2016 at 07:53:23PM -0700, Jeremy Huddleston Sequoia wrote:\n\n> Subject: Re: [PATCH] t4014-format-patch: Adjust git_version regex to better\n>  handle distro changes to DEF_VER\n>\n> Regressed-in: 480871e09ed2e5275b4ba16b278681e5a8c122ae\n> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>\n\nI see there was a discussion elsewhere on the list about exactly what\nyou are putting into DEF_VAR that causes the problem. Perhaps the commit\nmessage here would be a good place to mention that, why the current\nregex breaks it, and why your new version fixes not only it, but other\npossible values of DEF_VAR.\n\n-Peff\n"},{"id":"303729","messageId":"9A250ABE-1B54-4AD4-8DB5-026CC4725AB9@apple.com","threadId":"44266","inReplyTo":"20161010131041.lpdh4a7nol24hsz2@sigill.intra.peff.net","subject":"Re: [PATCH] t4014-format-patch: Adjust git_version regex to better handle distro changes to DEF_VER","fromName":"Jeremy Huddleston Sequoia","fromEmail":"jeremyhu@apple.com","sentAt":"2016-10-10T16:37:44Z","receivedAt":"2016-10-10T16:37:51Z","isPatch":true,"sender":{"key":"jeremyhu@apple.com","avatar":"https://avatars.githubusercontent.com/u/1258676?v=4"},"body":"\n> On Oct 10, 2016, at 06:10, Jeff King <peff@peff.net> wrote:\n> \n> On Sun, Oct 09, 2016 at 07:53:23PM -0700, Jeremy Huddleston Sequoia wrote:\n> \n>> Subject: Re: [PATCH] t4014-format-patch: Adjust git_version regex to better\n>> handle distro changes to DEF_VER\n>> \n>> Regressed-in: 480871e09ed2e5275b4ba16b278681e5a8c122ae\n>> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>\n> \n> I see there was a discussion elsewhere on the list about exactly what\n> you are putting into DEF_VAR that causes the problem. Perhaps the commit\n> message here would be a good place to mention that, why the current\n> regex breaks it, and why your new version fixes not only it, but other\n> possible values of DEF_VAR.\n\nThanks, I've added this blurb:\n\nFor example, git distributed with Apple's Xcode reports a version like:\n    git version 2.9.3 (Apple Git-75)\n\nApple started doing this to help customers distinguish between different\nversions of their packaged git which have the same base version (eg: with\ndifferent patches applied).\n\n"},{"id":"303730","messageId":"xmqqpon8gnp3.fsf@gitster.mtv.corp.google.com","threadId":"44266","inReplyTo":"20161010025323.9415-1-jeremyhu@apple.com","subject":"Re: [PATCH] t4014-format-patch: Adjust git_version regex to better handle distro changes to DEF_VER","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-10-10T16:42:48Z","receivedAt":"2016-10-10T16:43:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeremy Huddleston Sequoia <jeremyhu@apple.com> writes:\n\n> Regressed-in: 480871e09ed2e5275b4ba16b278681e5a8c122ae\n\nPlease be considerate to future readers of \"git log\" to help them\navoid mistakes earlier commits made that caused you troubles.\n\nThis line by itself without any explanation of what was broken is\nquite useless as a commit message.  What can the readers do?  They'd\ngo back and say \"git show 480871e09\" and then what?  The test added\nor modified by the commit has been working quite well for others\nsince it was made, so it is very likely the reader wouldn't be able\nto tell if anything is wrong in it.\n\nYou would help if you said what is different in _your_ environment\nfrom others who have happily been running and passing this test for\nothers to understand and learn from your fix.  What is it?\n\nThe \"Adjust ... distro changes\" in the title offers some hint but it\ncould be more explicit.  Please write something along this line\ninstead.\n\n    Subject: t4014: git --version can have SP in it\n\n    480871e09e (\"format-patch: show base info before email\n    signature\", 2016-09-07) added a helper function to recreate the\n    signature at the end of the e-mail, i.e. \"-- \" line followed by\n    the version string of Git, using output from \"git --version\" and\n    stripping everything before the last SP.\n\n    Because the default Git version string looks like \"git version\n    2.10.0-1-g480871e09e\", this was mostly OK, but people can change\n    this version string to arbitrary thing while compiling, which\n    can break the assumption if they had SP in it.  Notably, Apple\n    ships modified Git with \" (Apple Git-xx)\" appended to its\n    version number.\n\n    Instead, come up with the version string by stripping the \"git\n    version \" from the beginning.\n\n> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>\n\nGood.\n\n> CC: Josh Triplett <josh@joshtriplett.org>\n> CC: Junio C Hamano <gitster@pobox.com>\n\nPlease don't do this in your log message.  These belong to your\ne-mail headers, not here.\n\n> ---\n>  t/t4014-format-patch.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\n> index 8d90a6e..33f6940 100755\n> --- a/t/t4014-format-patch.sh\n> +++ b/t/t4014-format-patch.sh\n> @@ -754,7 +754,7 @@ test_expect_success 'format-patch --ignore-if-in-upstream HEAD' '\n>  \tgit format-patch --ignore-if-in-upstream HEAD\n>  '\n>  \n> -git_version=\"$(git --version | sed \"s/.* //\")\"\n> +git_version=\"$(git --version | sed \"s/git version //\")\"\n\nAnchor the fixed prefix to the beginning, so that we can protect\nourselves from another distro that would add \"git version\" in the\nmiddle of their arbitrary versioning scheme ;-).  I.e.\n\n    sed \"s/^git version //\"\n\n>  \n>  signature() {\n>  \tprintf \"%s\\n%s\\n\\n\" \"-- \" \"${1:-$git_version}\"\n"},{"id":"303731","messageId":"xmqqh98kgnio.fsf@gitster.mtv.corp.google.com","threadId":"44266","inReplyTo":"20161010131041.lpdh4a7nol24hsz2@sigill.intra.peff.net","subject":"Re: [PATCH] t4014-format-patch: Adjust git_version regex to better handle distro changes to DEF_VER","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-10-10T16:46:39Z","receivedAt":"2016-10-10T16:46:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Sun, Oct 09, 2016 at 07:53:23PM -0700, Jeremy Huddleston Sequoia wrote:\n>\n>> Subject: Re: [PATCH] t4014-format-patch: Adjust git_version regex to better\n>>  handle distro changes to DEF_VER\n>>\n>> Regressed-in: 480871e09ed2e5275b4ba16b278681e5a8c122ae\n>> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>\n>\n> I see there was a discussion elsewhere on the list about exactly what\n> you are putting into DEF_VAR that causes the problem. Perhaps the commit\n> message here would be a good place to mention that, why the current\n> regex breaks it, and why your new version fixes not only it, but other\n> possible values of DEF_VAR.\n\nAh, should have known that you'd already be helping with this.\nThanks.\n"},{"id":"303734","messageId":"A7BDC661-317E-49C1-A8B1-534A0DC26501@apple.com","threadId":"44266","inReplyTo":"xmqqpon8gnp3.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] t4014-format-patch: Adjust git_version regex to better handle distro changes to DEF_VER","fromName":"Jeremy Huddleston Sequoia","fromEmail":"jeremyhu@apple.com","sentAt":"2016-10-10T17:01:51Z","receivedAt":"2016-10-10T17:02:59Z","isPatch":true,"sender":{"key":"jeremyhu@apple.com","avatar":"https://avatars.githubusercontent.com/u/1258676?v=4"},"body":"\n> On Oct 10, 2016, at 09:42, Junio C Hamano <gitster@pobox.com> wrote:\n> \n> Jeremy Huddleston Sequoia <jeremyhu@apple.com> writes:\n> \n>> Regressed-in: 480871e09ed2e5275b4ba16b278681e5a8c122ae\n> \n> Please be considerate to future readers of \"git log\" to help them\n> avoid mistakes earlier commits made that caused you troubles.\n> \n> This line by itself without any explanation of what was broken is\n> quite useless as a commit message.  What can the readers do?  They'd\n> go back and say \"git show 480871e09\" and then what?  The test added\n> or modified by the commit has been working quite well for others\n> since it was made, so it is very likely the reader wouldn't be able\n> to tell if anything is wrong in it.\n> \n> You would help if you said what is different in _your_ environment\n> from others who have happily been running and passing this test for\n> others to understand and learn from your fix.  What is it?\n> \n> The \"Adjust ... distro changes\" in the title offers some hint but it\n> could be more explicit.  Please write something along this line\n> instead.\n> \n>    Subject: t4014: git --version can have SP in it\n> \n>    480871e09e (\"format-patch: show base info before email\n>    signature\", 2016-09-07) added a helper function to recreate the\n>    signature at the end of the e-mail, i.e. \"-- \" line followed by\n>    the version string of Git, using output from \"git --version\" and\n>    stripping everything before the last SP.\n> \n>    Because the default Git version string looks like \"git version\n>    2.10.0-1-g480871e09e\", this was mostly OK, but people can change\n>    this version string to arbitrary thing while compiling, which\n>    can break the assumption if they had SP in it.  Notably, Apple\n>    ships modified Git with \" (Apple Git-xx)\" appended to its\n>    version number.\n> \n>    Instead, come up with the version string by stripping the \"git\n>    version \" from the beginning.\n\nOk, I'll add that explanation to the commit message, thanks.\n\n\n> \n>> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>\n> \n> Good.\n> \n>> CC: Josh Triplett <josh@joshtriplett.org>\n>> CC: Junio C Hamano <gitster@pobox.com>\n> \n> Please don't do this in your log message.  These belong to your\n> e-mail headers, not here.\n\nSorry, we do that consistently on other projects during the review process, so git send-email picks them up and adds them automatically for each patch being sent out.  It's quite useful, actually.\n\n> \n>> ---\n>> t/t4014-format-patch.sh | 2 +-\n>> 1 file changed, 1 insertion(+), 1 deletion(-)\n>> \n>> diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\n>> index 8d90a6e..33f6940 100755\n>> --- a/t/t4014-format-patch.sh\n>> +++ b/t/t4014-format-patch.sh\n>> @@ -754,7 +754,7 @@ test_expect_success 'format-patch --ignore-if-in-upstream HEAD' '\n>> \tgit format-patch --ignore-if-in-upstream HEAD\n>> '\n>> \n>> -git_version=\"$(git --version | sed \"s/.* //\")\"\n>> +git_version=\"$(git --version | sed \"s/git version //\")\"\n> \n> Anchor the fixed prefix to the beginning, so that we can protect\n> ourselves from another distro that would add \"git version\" in the\n> middle of their arbitrary versioning scheme ;-).  I.e.\n> \n>    sed \"s/^git version //\"\n\nOk.\n\n> \n>> \n>> signature() {\n>> \tprintf \"%s\\n%s\\n\\n\" \"-- \" \"${1:-$git_version}\"\n\n"},{"id":"303919","messageId":"20161011200604.GA21967@starla","threadId":"44266","inReplyTo":"xmqqpon8gnp3.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] t4014-format-patch: Adjust git_version regex to better handle distro changes to DEF_VER","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2016-10-11T20:06:04Z","receivedAt":"2016-10-11T20:07:12Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> Jeremy Huddleston Sequoia <jeremyhu@apple.com> writes:\n> \n> > CC: Josh Triplett <josh@joshtriplett.org>\n> > CC: Junio C Hamano <gitster@pobox.com>\n> \n> Please don't do this in your log message.  These belong to your\n> e-mail headers, not here.\n\nFwiw, I prefer having these trailers.  It makes it easier to\nmaintain the Cc: list through multiple iterations/authors and is\nalso common practice on LKML.\n"}]}