{"thread":{"id":"56346","subject":"Git is removing . from the last part of user.name","startedAt":"2021-08-22T14:19:49Z","lastAt":"2023-08-02T21:38:44Z","messageCount":15,"participants":["Daniel P.","brian m. carlson","Jeff King","Junio C Hamano","Thomas J. Faughnan Jr."],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"433323","messageId":"CAL-s8C7makcRT_ufsv4THSrKeDkXfhFoAXSBKSiK5w0anMvZag@mail.gmail.com","threadId":"56346","inReplyTo":null,"subject":"Git is removing . from the last part of user.name","fromName":"Daniel P.","fromEmail":"danpltile@gmail.com","sentAt":"2021-08-22T14:19:33Z","receivedAt":"2021-08-22T14:19:49Z","isPatch":false,"sender":{"key":"danpltile@gmail.com","avatar":null},"body":"If user.name's  value has a . as the last character of the last part\nof the name, git is removing it from commit operations. But git-config\nshows the .\n\nexample:\n\nin .gitconfig:\n\n[user]\n    name = Daniel P.\n\n\n`git config user.name`:\n\nuser.name=Daniel P.\n\n\nfrom `git show`:\n\nAuthor: Daniel P <danpltile@gmail.com>\n"},{"id":"433325","messageId":"YSJuS1OoYsqgpF3j@camp.crustytoothpaste.net","threadId":"56346","inReplyTo":"CAL-s8C7makcRT_ufsv4THSrKeDkXfhFoAXSBKSiK5w0anMvZag@mail.gmail.com","subject":"Re: Git is removing . from the last part of user.name","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2021-08-22T15:33:31Z","receivedAt":"2021-08-22T15:34:09Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2021-08-22 at 14:19:33, Daniel P. wrote:\n> If user.name's  value has a . as the last character of the last part\n> of the name, git is removing it from commit operations. But git-config\n> shows the .\n> \n> example:\n> \n> in .gitconfig:\n> \n> [user]\n>     name = Daniel P.\n> \n> \n> `git config user.name`:\n> \n> user.name=Daniel P.\n> \n> \n> from `git show`:\n> \n> Author: Daniel P <danpltile@gmail.com>\n\nYes, it does appear we do that.  We consider a period to be \"crud\" and\nstrip off trailing crud.  I think we should probably change that, since\nin some places people write their family name first, and so a name like\n“carlson brian m.” might be a thing people might want to write, in\naddition to this particular case.\n\nIn any event, it's not very polite to \"correct\" people's names for them.\nI myself have certainly run into that often enough.\n-- \nbrian m. carlson (he/him or they/them)\nToronto, Ontario, CA\n"},{"id":"433331","messageId":"YSKleNynVrWWyyML@coredump.intra.peff.net","threadId":"56346","inReplyTo":"YSJuS1OoYsqgpF3j@camp.crustytoothpaste.net","subject":"Re: Git is removing . from the last part of user.name","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-08-22T19:28:56Z","receivedAt":"2021-08-22T19:28:59Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Aug 22, 2021 at 03:33:31PM +0000, brian m. carlson wrote:\n\n> On 2021-08-22 at 14:19:33, Daniel P. wrote:\n> > If user.name's  value has a . as the last character of the last part\n> > of the name, git is removing it from commit operations. But git-config\n> > shows the .\n> > \n> > example:\n> > \n> > in .gitconfig:\n> > \n> > [user]\n> >     name = Daniel P.\n> > \n> > \n> > `git config user.name`:\n> > \n> > user.name=Daniel P.\n> > \n> > \n> > from `git show`:\n> > \n> > Author: Daniel P <danpltile@gmail.com>\n> \n> Yes, it does appear we do that.  We consider a period to be \"crud\" and\n> strip off trailing crud.  I think we should probably change that, since\n> in some places people write their family name first, and so a name like\n> “carlson brian m.” might be a thing people might want to write, in\n> addition to this particular case.\n> \n> In any event, it's not very polite to \"correct\" people's names for them.\n> I myself have certainly run into that often enough.\n\nA lot of this name-cleanup code came from an era where we were inferring\nnames from gecos fields or from hacky email parsing.\n\nI agree that if somebody has given us a definite name via config, we\nshould mostly leave it intact (the exception being syntactic elements\nlike <>). But we may still want to keep some of the \"crud\" cleanup when\nwe are pulling from those other sources.\n\nOTOH, this crud stuff goes all the way back to 5e5128ed1c (Remove\nextraneous ',' ';' and '.' characters from the full name gecos field.,\n2005-04-17). We warn in pretty big letters these days about pulling an\nident from gecos, and our rfc822 parsing is more robust than it once\nwas. So it may be time to just retire most of it. The unfortunate thing\nis we won't know how many people complain until it's released.\n\nOn a somewhat lesser note, I'm tempted to say that \".\" probably was\nnever that useful (compared to say, comma, which is the gecos\nseparator), and we could probably just drop it from the crud list.\n\n-Peff\n"},{"id":"433333","messageId":"YSKm8Q8nyTavQaox@coredump.intra.peff.net","threadId":"56346","inReplyTo":"YSKleNynVrWWyyML@coredump.intra.peff.net","subject":"Re: Git is removing . from the last part of user.name","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-08-22T19:35:13Z","receivedAt":"2021-08-22T19:35:22Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Aug 22, 2021 at 03:28:57PM -0400, Jeff King wrote:\n\n> On a somewhat lesser note, I'm tempted to say that \".\" probably was\n> never that useful (compared to say, comma, which is the gecos\n> separator), and we could probably just drop it from the crud list.\n\nThis does break a few tests, but none that I think explicitly were\narguing for keeping the dot. One was just a general crud test, and the\nother was just documenting the current behavior while testing something\nelse (and perhaps even argues _for_ the change, as somebody bothered to\nwrite --author='Jane D.' in the first place).\n\n---\ndiff --git a/ident.c b/ident.c\nindex 85d9ba7120..2d136d27c8 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -198,7 +198,6 @@ void reset_ident_date(void)\n static int crud(unsigned char c)\n {\n \treturn  c <= 32  ||\n-\t\tc == '.' ||\n \t\tc == ',' ||\n \t\tc == ':' ||\n \t\tc == ';' ||\ndiff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh\nindex 0b2d21ec55..a1cdc2905f 100755\n--- a/t/t4203-mailmap.sh\n+++ b/t/t4203-mailmap.sh\n@@ -466,7 +466,7 @@ test_expect_success 'gitmailmap(5) example output: example #1' '\n \tAuthor Jane Doe <jane@laptop.(none)> maps to Jane Doe <jane@laptop.(none)>\n \tCommitter C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>\n \n-\tAuthor Jane D <jane@desktop.(none)> maps to Jane Doe <jane@desktop.(none)>\n+\tAuthor Jane D. <jane@desktop.(none)> maps to Jane Doe <jane@desktop.(none)>\n \tCommitter C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>\n \tEOF\n \tgit -C doc log --reverse --pretty=format:\"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n\" >actual &&\n@@ -494,7 +494,7 @@ test_expect_success 'gitmailmap(5) example output: example #2' '\n \tAuthor Jane Doe <jane@laptop.(none)> maps to Jane Doe <jane@example.com>\n \tCommitter C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>\n \n-\tAuthor Jane D <jane@desktop.(none)> maps to Jane Doe <jane@example.com>\n+\tAuthor Jane D. <jane@desktop.(none)> maps to Jane Doe <jane@example.com>\n \tCommitter C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>\n \tEOF\n \tgit -C doc log --reverse --pretty=format:\"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n\" >actual &&\ndiff --git a/t/t7518-ident-corner-cases.sh b/t/t7518-ident-corner-cases.sh\nindex 905957bd0a..738c723861 100755\n--- a/t/t7518-ident-corner-cases.sh\n+++ b/t/t7518-ident-corner-cases.sh\n@@ -18,7 +18,7 @@ test_expect_success 'empty name and missing email' '\n '\n \n test_expect_success 'commit rejects all-crud name' '\n-\ttest_must_fail env GIT_AUTHOR_NAME=\" .;<>\" \\\n+\ttest_must_fail env GIT_AUTHOR_NAME=\" ,;<>\" \\\n \t\tgit commit --allow-empty -m foo\n '\n \n"},{"id":"433458","messageId":"xmqqsfz0qgbd.fsf@gitster.g","threadId":"56346","inReplyTo":"YSKleNynVrWWyyML@coredump.intra.peff.net","subject":"Re: Git is removing . from the last part of user.name","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-08-23T16:25:10Z","receivedAt":"2021-08-23T16:25:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On a somewhat lesser note, I'm tempted to say that \".\" probably was\n> never that useful (compared to say, comma, which is the gecos\n> separator), and we could probably just drop it from the crud list.\n\nYeah, the only excuse I can think of using to justify treating \".\"\nany specially can be seen in the contrast between the To: and Cc:\nheader of this message, where the human-readable part of brian and\ndaniel must be inside a pair of double-quotes while your name needs\nno such quoting.\n\nBut we do not remove \"crud()\" crud from the middle, so that's not\neven it (the only crud we remvoe from the middle are newlines and\n'<' and '>').\n\n\n\n"},{"id":"479987","messageId":"CUFTY8BW9NHM.132KSE56BDE8Q@badwolf","threadId":"56346","inReplyTo":"YSKleNynVrWWyyML@coredump.intra.peff.net","subject":"Re: Git is removing . from the last part of user.name","fromName":"Thomas J. Faughnan Jr.","fromEmail":"thomas@faughnan.net","sentAt":"2023-07-30T21:38:13Z","receivedAt":"2023-07-30T21:43:00Z","isPatch":false,"sender":{"key":"thomas@faughnan.net","avatar":null},"body":"> On a somewhat lesser note, I'm tempted to say that \".\" probably was\n> never that useful (compared to say, comma, which is the gecos\n> separator), and we could probably just drop it from the crud list.\n\nWould this change still be considered? Or alternatively a git config\noption to ignore \".\" when checking if a character is crud?\n"},{"id":"479999","messageId":"xmqq351413dy.fsf@gitster.g","threadId":"56346","inReplyTo":"CUFTY8BW9NHM.132KSE56BDE8Q@badwolf","subject":"Re: Git is removing . from the last part of user.name","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-07-31T15:56:09Z","receivedAt":"2023-07-31T15:56:36Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Thomas J. Faughnan Jr.\" <thomas@faughnan.net> writes:\n\n>> On a somewhat lesser note, I'm tempted to say that \".\" probably was\n>> never that useful (compared to say, comma, which is the gecos\n>> separator), and we could probably just drop it from the crud list.\n>\n> Would this change still be considered? Or alternatively a git config\n> option to ignore \".\" when checking if a character is crud?\n\nThat is certainly a blast from the past ;-)\n\nI actually was wondering the opposite should be done, i.e. be\nconsistent and remove '.'  just like '<' and '>' even from the\nmiddle of names.  '.' in the human-readable name part anywhere on\nTo: and Cc: lines, not just at the end, causes mailers to barf,\nunless such name is quoted.\n\nAnd from the consistency point of view, I think that a configuration\nvariable that tells Git to include/exclude \".\" from the \"crud()\"\nletter should make us drop/keep \".\" from anywhere in the name, not\njust at the tail end.  If we decide that adding such a configuration\nvariable is a good idea, that is.\n\n\n"},{"id":"480012","messageId":"ZMghdgIaQB4L88WR@tapette.crustytoothpaste.net","threadId":"56346","inReplyTo":"xmqq351413dy.fsf@gitster.g","subject":"Re: Git is removing . from the last part of user.name","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2023-07-31T21:02:46Z","receivedAt":"2023-07-31T21:02:57Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2023-07-31 at 15:56:09, Junio C Hamano wrote:\n> \"Thomas J. Faughnan Jr.\" <thomas@faughnan.net> writes:\n> \n> >> On a somewhat lesser note, I'm tempted to say that \".\" probably was\n> >> never that useful (compared to say, comma, which is the gecos\n> >> separator), and we could probably just drop it from the crud list.\n> >\n> > Would this change still be considered? Or alternatively a git config\n> > option to ignore \".\" when checking if a character is crud?\n> \n> That is certainly a blast from the past ;-)\n> \n> I actually was wondering the opposite should be done, i.e. be\n> consistent and remove '.'  just like '<' and '>' even from the\n> middle of names.  '.' in the human-readable name part anywhere on\n> To: and Cc: lines, not just at the end, causes mailers to barf,\n> unless such name is quoted.\n\nFor obvious reasons, I think that's a terrible idea.  I don't think we\nshould have such a config option, and should instead just drop \".\" from\nthe crud list.  I would welcome such a change.\n-- \nbrian m. carlson (he/him or they/them)\nToronto, Ontario, CA\n"},{"id":"480013","messageId":"20230731214435.1462098-1-sandals@crustytoothpaste.net","threadId":"56346","inReplyTo":"ZMghdgIaQB4L88WR@tapette.crustytoothpaste.net","subject":"[PATCH] ident: don't consider trailing dot crud","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2023-07-31T21:44:35Z","receivedAt":"2023-07-31T21:44:51Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"When we process a user's name (as in user.name), we strip all trailing\ncrud from it.  Right now, we consider a dot trailing crud, and strip it\noff.\n\nHowever, this is unsuitable for many personal names because humans\nfrequently have abbreviated suffixes, such as \"Jr.\" or \"Sr.\" at the end\nof their names, and this corrupts them.  Some other users may wish to\nuse an abbreviated name or initial, which will pose a problem especially\nin cultures that write the family name first, followed by the personal\nname.\n\nSince the current approach causes lots of practical problems, let's\navoid it by no longer considering a dot to be crud.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n ident.c                       |  1 -\n t/t4203-mailmap.sh            |  4 ++--\n t/t7518-ident-corner-cases.sh | 11 ++++++++++-\n 3 files changed, 12 insertions(+), 4 deletions(-)\n\ndiff --git a/ident.c b/ident.c\nindex 08be4d0747..cc7afdbf81 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -203,7 +203,6 @@ void reset_ident_date(void)\n static int crud(unsigned char c)\n {\n \treturn  c <= 32  ||\n-\t\tc == '.' ||\n \t\tc == ',' ||\n \t\tc == ':' ||\n \t\tc == ';' ||\ndiff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh\nindex fa7f987284..2016132f51 100755\n--- a/t/t4203-mailmap.sh\n+++ b/t/t4203-mailmap.sh\n@@ -466,7 +466,7 @@ test_expect_success 'gitmailmap(5) example output: example #1' '\n \tAuthor Jane Doe <jane@laptop.(none)> maps to Jane Doe <jane@laptop.(none)>\n \tCommitter C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>\n \n-\tAuthor Jane D <jane@desktop.(none)> maps to Jane Doe <jane@desktop.(none)>\n+\tAuthor Jane D. <jane@desktop.(none)> maps to Jane Doe <jane@desktop.(none)>\n \tCommitter C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>\n \tEOF\n \tgit -C doc log --reverse --pretty=format:\"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n\" >actual &&\n@@ -494,7 +494,7 @@ test_expect_success 'gitmailmap(5) example output: example #2' '\n \tAuthor Jane Doe <jane@laptop.(none)> maps to Jane Doe <jane@example.com>\n \tCommitter C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>\n \n-\tAuthor Jane D <jane@desktop.(none)> maps to Jane Doe <jane@example.com>\n+\tAuthor Jane D. <jane@desktop.(none)> maps to Jane Doe <jane@example.com>\n \tCommitter C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>\n \tEOF\n \tgit -C doc log --reverse --pretty=format:\"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n\" >actual &&\ndiff --git a/t/t7518-ident-corner-cases.sh b/t/t7518-ident-corner-cases.sh\nindex fffdb6ff2e..9ab2ae2f3b 100755\n--- a/t/t7518-ident-corner-cases.sh\n+++ b/t/t7518-ident-corner-cases.sh\n@@ -20,10 +20,19 @@ test_expect_success 'empty name and missing email' '\n '\n \n test_expect_success 'commit rejects all-crud name' '\n-\ttest_must_fail env GIT_AUTHOR_NAME=\" .;<>\" \\\n+\ttest_must_fail env GIT_AUTHOR_NAME=\" ,;<>\" \\\n \t\tgit commit --allow-empty -m foo\n '\n \n+test_expect_success 'commit does not strip trailing dot' '\n+\tauthor_name=\"Pat Doe Jr.\" &&\n+\tenv GIT_AUTHOR_NAME=\"$author_name\" \\\n+\t\tgit commit --allow-empty -m foo &&\n+\tgit log -1 --format=%an >actual &&\n+\techo \"$author_name\" >expected &&\n+\ttest_cmp actual expected\n+'\n+\n # We must test the actual error message here, as an unwanted\n # auto-detection could fail for other reasons.\n test_expect_success 'empty configured name does not auto-detect' '\n"},{"id":"480014","messageId":"xmqqpm4721lm.fsf@gitster.g","threadId":"56346","inReplyTo":"20230731214435.1462098-1-sandals@crustytoothpaste.net","subject":"Re: [PATCH] ident: don't consider trailing dot crud","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-07-31T21:49:25Z","receivedAt":"2023-07-31T21:49:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n\n> When we process a user's name (as in user.name), we strip all trailing\n> crud from it.  Right now, we consider a dot trailing crud, and strip it\n> off.\n\nWe consider a leading or trailing dot crud, I think (applies also to\nthe title of the patch).  Otherwise the change, together with the\ntest updates, all look good.\n\nI wonder if this needs some credit to those involved in the original\nthread?\n\nThanks.\n\n> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n> ---\n>  ident.c                       |  1 -\n>  t/t4203-mailmap.sh            |  4 ++--\n>  t/t7518-ident-corner-cases.sh | 11 ++++++++++-\n>  3 files changed, 12 insertions(+), 4 deletions(-)\n>\n> diff --git a/ident.c b/ident.c\n> index 08be4d0747..cc7afdbf81 100644\n> --- a/ident.c\n> +++ b/ident.c\n> @@ -203,7 +203,6 @@ void reset_ident_date(void)\n>  static int crud(unsigned char c)\n>  {\n>  \treturn  c <= 32  ||\n> -\t\tc == '.' ||\n>  \t\tc == ',' ||\n>  \t\tc == ':' ||\n>  \t\tc == ';' ||\n> diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh\n> index fa7f987284..2016132f51 100755\n> --- a/t/t4203-mailmap.sh\n> +++ b/t/t4203-mailmap.sh\n> @@ -466,7 +466,7 @@ test_expect_success 'gitmailmap(5) example output: example #1' '\n>  \tAuthor Jane Doe <jane@laptop.(none)> maps to Jane Doe <jane@laptop.(none)>\n>  \tCommitter C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>\n>  \n> -\tAuthor Jane D <jane@desktop.(none)> maps to Jane Doe <jane@desktop.(none)>\n> +\tAuthor Jane D. <jane@desktop.(none)> maps to Jane Doe <jane@desktop.(none)>\n>  \tCommitter C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>\n>  \tEOF\n>  \tgit -C doc log --reverse --pretty=format:\"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n\" >actual &&\n> @@ -494,7 +494,7 @@ test_expect_success 'gitmailmap(5) example output: example #2' '\n>  \tAuthor Jane Doe <jane@laptop.(none)> maps to Jane Doe <jane@example.com>\n>  \tCommitter C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>\n>  \n> -\tAuthor Jane D <jane@desktop.(none)> maps to Jane Doe <jane@example.com>\n> +\tAuthor Jane D. <jane@desktop.(none)> maps to Jane Doe <jane@example.com>\n>  \tCommitter C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>\n>  \tEOF\n>  \tgit -C doc log --reverse --pretty=format:\"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n\" >actual &&\n> diff --git a/t/t7518-ident-corner-cases.sh b/t/t7518-ident-corner-cases.sh\n> index fffdb6ff2e..9ab2ae2f3b 100755\n> --- a/t/t7518-ident-corner-cases.sh\n> +++ b/t/t7518-ident-corner-cases.sh\n> @@ -20,10 +20,19 @@ test_expect_success 'empty name and missing email' '\n>  '\n>  \n>  test_expect_success 'commit rejects all-crud name' '\n> -\ttest_must_fail env GIT_AUTHOR_NAME=\" .;<>\" \\\n> +\ttest_must_fail env GIT_AUTHOR_NAME=\" ,;<>\" \\\n>  \t\tgit commit --allow-empty -m foo\n>  '\n>  \n> +test_expect_success 'commit does not strip trailing dot' '\n> +\tauthor_name=\"Pat Doe Jr.\" &&\n> +\tenv GIT_AUTHOR_NAME=\"$author_name\" \\\n> +\t\tgit commit --allow-empty -m foo &&\n> +\tgit log -1 --format=%an >actual &&\n> +\techo \"$author_name\" >expected &&\n> +\ttest_cmp actual expected\n> +'\n> +\n>  # We must test the actual error message here, as an unwanted\n>  # auto-detection could fail for other reasons.\n>  test_expect_success 'empty configured name does not auto-detect' '\n"},{"id":"480015","messageId":"CUGOYGU96P8T.3EUVTC5SAFW36@badwolf","threadId":"56346","inReplyTo":"20230731214435.1462098-1-sandals@crustytoothpaste.net","subject":"Re: [PATCH] ident: don't consider trailing dot crud","fromName":"Thomas J. Faughnan Jr.","fromEmail":"thomas@faughnan.net","sentAt":"2023-07-31T21:56:06Z","receivedAt":"2023-07-31T21:56:48Z","isPatch":true,"sender":{"key":"thomas@faughnan.net","avatar":null},"body":"I agree that simply dropping the \".\" from the crud list is the best\nsolution. Hope this gets merged.\n"},{"id":"480016","messageId":"xmqqleev20um.fsf@gitster.g","threadId":"56346","inReplyTo":"CUGOYGU96P8T.3EUVTC5SAFW36@badwolf","subject":"Re: [PATCH] ident: don't consider trailing dot crud","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-07-31T22:05:37Z","receivedAt":"2023-07-31T22:05:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Thomas J. Faughnan Jr.\" <thomas@faughnan.net> writes:\n\n> I agree that simply dropping the \".\" from the crud list is the best\n> solution. Hope this gets merged.\n\nSure, I do too hope this gets into a shape that can be merged.\n"},{"id":"480097","messageId":"xmqqsf918k4j.fsf@gitster.g","threadId":"56346","inReplyTo":"xmqqpm4721lm.fsf@gitster.g","subject":"Re: [PATCH] ident: don't consider trailing dot crud","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-08-02T16:49:32Z","receivedAt":"2023-08-02T16:50:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> I wonder if this needs some credit to those involved in the original\n> thread?\n\nI've had this on 'seen' as-is, hoping to see a quick update so that\nwe can merge it down to 'next' before -rc0; here is a minimally\ntouched-up version I'll replace it with.\n\nThanks.\n\n------- >8 ------------- >8 ------------- >8 ------------- >8 -------\nFrom: \"brian m. carlson\" <sandals@crustytoothpaste.net>\nSubject: [PATCH] ident: don't consider '.' a crud\n\nWhen we process a user's name (as in user.name), we strip all\nleading and trailing crud from it.  Right now, we consider a dot\na crud character, and strip it off.\n\nHowever, this is unsuitable for many personal names because humans\nfrequently have abbreviated suffixes, such as \"Jr.\" or \"Sr.\" at the end\nof their names, and this corrupts them.  Some other users may wish to\nuse an abbreviated name or initial, which will pose a problem especially\nin cultures that write the family name first, followed by the personal\nname.\n\nSince the current approach causes lots of practical problems, let's\navoid it by no longer considering a dot to be crud.\n\nNote that \".\" in the name forces the entire name to be quoted to\nplease mailers, but stripping \".\" only at the beginning and the end\ndoes not help a name with \".\" in the middle (like \"brian m. carlson\")\nso this change will not make it much worse.  A name like \"Given\nFamily, Jr.\" that did not have to be quoted now would need to be, in\norder to be placed on the e-mail headers, though.\n\nThis is based on a weather-balloon patch by Jeff King sent in Aug 2021\nhttps://lore.kernel.org/git/YSKm8Q8nyTavQaox@coredump.intra.peff.net/\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n1:  4ce0751970 ! 1:  9478b6dadc ident: don't consider trailing dot crud\n    @@ Metadata\n     Author: brian m. carlson <sandals@crustytoothpaste.net>\n     \n      ## Commit message ##\n    -    ident: don't consider trailing dot crud\n    +    ident: don't consider '.' a crud\n     \n    -    When we process a user's name (as in user.name), we strip all trailing\n    -    crud from it.  Right now, we consider a dot trailing crud, and strip it\n    -    off.\n    +    When we process a user's name (as in user.name), we strip all\n    +    leading and trailing crud from it.  Right now, we consider a dot\n    +    a crud character, and strip it off.\n     \n         However, this is unsuitable for many personal names because humans\n         frequently have abbreviated suffixes, such as \"Jr.\" or \"Sr.\" at the end\n    @@ Commit message\n         Since the current approach causes lots of practical problems, let's\n         avoid it by no longer considering a dot to be crud.\n     \n    +    Note that \".\" in the name forces the entire name to be quoted to\n    +    please mailers, but stripping \".\" only at the beginning and the end\n    +    does not help a name with \".\" in the middle (like \"brian m. carlson\")\n    +    so this change will not make it much worse.  A name like \"Given\n    +    Family, Jr.\" that did not have to be quoted now would need to be, in\n    +    order to be placed on the e-mail headers, though.\n    +\n    +    This is based on a weather-balloon patch by Jeff King sent in Aug 2021\n    +    https://lore.kernel.org/git/YSKm8Q8nyTavQaox@coredump.intra.peff.net/\n    +\n         Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n         Signed-off-by: Junio C Hamano <gitster@pobox.com>\n     \n\n\n\n ident.c                       |  1 -\n t/t4203-mailmap.sh            |  4 ++--\n t/t7518-ident-corner-cases.sh | 11 ++++++++++-\n 3 files changed, 12 insertions(+), 4 deletions(-)\n\ndiff --git a/ident.c b/ident.c\nindex 8fad92d700..8d490df7d5 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -203,7 +203,6 @@ void reset_ident_date(void)\n static int crud(unsigned char c)\n {\n \treturn  c <= 32  ||\n-\t\tc == '.' ||\n \t\tc == ',' ||\n \t\tc == ':' ||\n \t\tc == ';' ||\ndiff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh\nindex fa7f987284..2016132f51 100755\n--- a/t/t4203-mailmap.sh\n+++ b/t/t4203-mailmap.sh\n@@ -466,7 +466,7 @@ test_expect_success 'gitmailmap(5) example output: example #1' '\n \tAuthor Jane Doe <jane@laptop.(none)> maps to Jane Doe <jane@laptop.(none)>\n \tCommitter C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>\n \n-\tAuthor Jane D <jane@desktop.(none)> maps to Jane Doe <jane@desktop.(none)>\n+\tAuthor Jane D. <jane@desktop.(none)> maps to Jane Doe <jane@desktop.(none)>\n \tCommitter C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>\n \tEOF\n \tgit -C doc log --reverse --pretty=format:\"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n\" >actual &&\n@@ -494,7 +494,7 @@ test_expect_success 'gitmailmap(5) example output: example #2' '\n \tAuthor Jane Doe <jane@laptop.(none)> maps to Jane Doe <jane@example.com>\n \tCommitter C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>\n \n-\tAuthor Jane D <jane@desktop.(none)> maps to Jane Doe <jane@example.com>\n+\tAuthor Jane D. <jane@desktop.(none)> maps to Jane Doe <jane@example.com>\n \tCommitter C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>\n \tEOF\n \tgit -C doc log --reverse --pretty=format:\"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n\" >actual &&\ndiff --git a/t/t7518-ident-corner-cases.sh b/t/t7518-ident-corner-cases.sh\nindex fffdb6ff2e..9ab2ae2f3b 100755\n--- a/t/t7518-ident-corner-cases.sh\n+++ b/t/t7518-ident-corner-cases.sh\n@@ -20,10 +20,19 @@ test_expect_success 'empty name and missing email' '\n '\n \n test_expect_success 'commit rejects all-crud name' '\n-\ttest_must_fail env GIT_AUTHOR_NAME=\" .;<>\" \\\n+\ttest_must_fail env GIT_AUTHOR_NAME=\" ,;<>\" \\\n \t\tgit commit --allow-empty -m foo\n '\n \n+test_expect_success 'commit does not strip trailing dot' '\n+\tauthor_name=\"Pat Doe Jr.\" &&\n+\tenv GIT_AUTHOR_NAME=\"$author_name\" \\\n+\t\tgit commit --allow-empty -m foo &&\n+\tgit log -1 --format=%an >actual &&\n+\techo \"$author_name\" >expected &&\n+\ttest_cmp actual expected\n+'\n+\n # We must test the actual error message here, as an unwanted\n # auto-detection could fail for other reasons.\n test_expect_success 'empty configured name does not auto-detect' '\n-- \n2.41.0-478-gee48e70a82\n\n"},{"id":"480104","messageId":"ZMrKXvdshOAHVGqV@tapette.crustytoothpaste.net","threadId":"56346","inReplyTo":"xmqqsf918k4j.fsf@gitster.g","subject":"Re: [PATCH] ident: don't consider trailing dot crud","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2023-08-02T21:27:58Z","receivedAt":"2023-08-02T21:28:10Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2023-08-02 at 16:49:32, Junio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> > I wonder if this needs some credit to those involved in the original\n> > thread?\n> \n> I've had this on 'seen' as-is, hoping to see a quick update so that\n> we can merge it down to 'next' before -rc0; here is a minimally\n> touched-up version I'll replace it with.\n\nThat's fine.  I was planning to do a re-roll today (since my Tuesdays\ntend to be occupied with French classes), but I'm happy with what you\nhave.  Let me know if you're expecting a re-roll nevertheless, and I'll\ntry to get one out to you.\n-- \nbrian m. carlson (he/him or they/them)\nToronto, Ontario, CA\n"},{"id":"480105","messageId":"xmqqttth6s6g.fsf@gitster.g","threadId":"56346","inReplyTo":"ZMrKXvdshOAHVGqV@tapette.crustytoothpaste.net","subject":"Re: [PATCH] ident: don't consider trailing dot crud","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-08-02T21:38:31Z","receivedAt":"2023-08-02T21:38:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n\n> On 2023-08-02 at 16:49:32, Junio C Hamano wrote:\n>> Junio C Hamano <gitster@pobox.com> writes:\n>> \n>> > I wonder if this needs some credit to those involved in the original\n>> > thread?\n>> \n>> I've had this on 'seen' as-is, hoping to see a quick update so that\n>> we can merge it down to 'next' before -rc0; here is a minimally\n>> touched-up version I'll replace it with.\n>\n> That's fine.  I was planning to do a re-roll today (since my Tuesdays\n> tend to be occupied with French classes), but I'm happy with what you\n> have.  Let me know if you're expecting a re-roll nevertheless, and I'll\n> try to get one out to you.\n\nNah, your message I am responding to is just as good as a reroll.\n\nAfter all we are not propagating cryptographic signatures in your\ne-mail to resulting commits, so it would not make any difference ;-)\n\nThanks.\n"}]}