{"thread":{"id":"64130","subject":"[DISCUSS] validation on git config user.email","startedAt":"2025-09-12T04:13:19Z","lastAt":"2025-09-15T13:40:38Z","messageCount":14,"participants":["usharerose","rsbecker@nexbridge.com","Konstantin Ryabitsev","Thomas Guyot","Junio C Hamano","Kristoffer Haugsbakk"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"526167","messageId":"CAJKmQvf-sLxowLJLitvqDmyL1BXXDK+anDE2jaBSEabApMNVoQ@mail.gmail.com","threadId":"64130","inReplyTo":null,"subject":"[DISCUSS] validation on git config user.email","fromName":"usharerose","fromEmail":"ushareroses@gmail.com","sentAt":"2025-09-12T04:13:07Z","receivedAt":"2025-09-12T04:13:19Z","isPatch":false,"sender":{"key":"ushareroses@gmail.com","avatar":null},"body":"Hi, Git Community,\n\nI'm a Git user and curious about a specific aspect of Git's design\nregarding the 'user.email' configuration.\n\nGit allows any kind of values without restriction when setting\n'user.email' via 'git config' (e.g., `git config user.email\n\"not-a-valid-email-address\"`).\n\nI'm interested in understanding the design philosophy or historical\nreasons behind this 'lack' of validation.\n\nI've glanced through the documentations, archived emails, or forum\ntopics, but couldn't find a definitive or official statement.\n\nThanks for your time and insights.\n"},{"id":"526195","messageId":"071101dc23f5$fbf06e30$f3d14a90$@nexbridge.com","threadId":"64130","inReplyTo":"CAJKmQvf-sLxowLJLitvqDmyL1BXXDK+anDE2jaBSEabApMNVoQ@mail.gmail.com","subject":"RE: [DISCUSS] validation on git config user.email","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2025-09-12T15:00:25Z","receivedAt":"2025-09-12T15:00:39Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On September 12, 2025 12:13 AM, usharerose wrote:\n>I'm a Git user and curious about a specific aspect of Git's design regarding the\n>'user.email' configuration.\n>\n>Git allows any kind of values without restriction when setting 'user.email' via 'git\n>config' (e.g., `git config user.email \"not-a-valid-email-address\"`).\n>\n>I'm interested in understanding the design philosophy or historical reasons behind\n>this 'lack' of validation.\n>\n>I've glanced through the documentations, archived emails, or forum topics, but\n>couldn't find a definitive or official statement.\n>\n>Thanks for your time and insights.\n\nSome customers integrate single sign-on (SSO) via the user.email value. In the case\nof one customer I helped, the value is an SSO token used by GitHub for their\nintegration. The token value does not conform to any valid email address format.\nAdding an email validation will lock them out of using git.\n\n--Randall\n\n"},{"id":"526196","messageId":"20250912-curvy-owl-of-growth-a84dfc@lemur","threadId":"64130","inReplyTo":"CAJKmQvf-sLxowLJLitvqDmyL1BXXDK+anDE2jaBSEabApMNVoQ@mail.gmail.com","subject":"Re: [DISCUSS] validation on git config user.email","fromName":"Konstantin Ryabitsev","fromEmail":"konstantin@linuxfoundation.org","sentAt":"2025-09-12T15:13:04Z","receivedAt":"2025-09-12T15:13:06Z","isPatch":false,"sender":{"key":"konstantin@linuxfoundation.org","avatar":"https://gravatar.com/avatar/7cb8827c6de56e1bd2dea16508c6708aa43feed3bf3813bcdacecdf96ceadd79?d=mp&s=160"},"body":"On Fri, Sep 12, 2025 at 12:13:07PM +0800, usharerose wrote:\n> Hi, Git Community,\n> \n> I'm a Git user and curious about a specific aspect of Git's design\n> regarding the 'user.email' configuration.\n> \n> Git allows any kind of values without restriction when setting\n> 'user.email' via 'git config' (e.g., `git config user.email\n> \"not-a-valid-email-address\"`).\n\nThat's a valid email address on the local system. It will get expanded into\nnot-a-valid-email-address@localhost (or whatever domain is configured with the\nlocal MTA).\n\n> I'm interested in understanding the design philosophy or historical\n> reasons behind this 'lack' of validation.\n\nThis may be insightful: https://e-mail.wtf\n\n:)\n\n-K\n"},{"id":"526197","messageId":"45640ca0-b3c5-4627-b41a-0b58ff559d2b@gmail.com","threadId":"64130","inReplyTo":"CAJKmQvf-sLxowLJLitvqDmyL1BXXDK+anDE2jaBSEabApMNVoQ@mail.gmail.com","subject":"Re: [DISCUSS] validation on git config user.email","fromName":"Thomas Guyot","fromEmail":"tguyot@gmail.com","sentAt":"2025-09-12T15:39:41Z","receivedAt":"2025-09-12T15:39:45Z","isPatch":false,"sender":{"key":"tguyot@gmail.com","avatar":"https://avatars.githubusercontent.com/u/403890?v=4"},"body":"On 2025-09-12 00:13, usharerose wrote:\n> \n> I'm interested in understanding the design philosophy or historical\n> reasons behind this 'lack' of validation.\n> \n\nHi usharerose,\n\nTo add to the other valid responses, email is something that can be \nvalidated by hooks server-side to enforce not only proper formatting but \nalso valid users are being used, ex. validating against an LDAP directory.\n\nThis is much better that validating it at the command level (although \nIIRC git-comit does warn about possibly unset/invalid email addresses). \nIn addition, unless git starts enforcing stricter rules on the commit \nmessage format (which would be a breaking change), nothing else can \nprevent someone from constructing commits with invalid emails, so checks \nby git-commit alone can't be strictly enforceable.\n\nFurthermore, imported commits from other SCMs may have odd user \nname/email and it may be desirable to keep then in their original \nformats rather than turning them into fake email addresses.\n\nRegards,\n\n--\nThomas\n"},{"id":"526202","messageId":"xmqqtt17my71.fsf@gitster.g","threadId":"64130","inReplyTo":"071101dc23f5$fbf06e30$f3d14a90$@nexbridge.com","subject":"Re: [DISCUSS] validation on git config user.email","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-09-12T16:29:22Z","receivedAt":"2025-09-12T16:29:24Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"<rsbecker@nexbridge.com> writes:\n\n> Some customers integrate single sign-on (SSO) via the user.email value. In the case\n> of one customer I helped, the value is an SSO token used by GitHub for their\n> integration. The token value does not conform to any valid email address format.\n> Adding an email validation will lock them out of using git.\n\nThat is a very good point.  We need to remember that not all users\nuse the value of the field we define to be \"email\" to send emails\nto, just like some people use \"name\" field to store something that\nis not their name.\n"},{"id":"526209","messageId":"CAJKmQvcqLzJDnpYg5K7_eUNCUdLCkkFse-wB+4R8KGxKo_e+0w@mail.gmail.com","threadId":"64130","inReplyTo":"071101dc23f5$fbf06e30$f3d14a90$@nexbridge.com","subject":"Re: [DISCUSS] validation on git config user.email","fromName":"usharerose","fromEmail":"ushareroses@gmail.com","sentAt":"2025-09-12T16:52:18Z","receivedAt":"2025-09-12T16:52:31Z","isPatch":false,"sender":{"key":"ushareroses@gmail.com","avatar":null},"body":"On Fri, Sep 12, 2025 at 11:00 PM <rsbecker@nexbridge.com> wrote:\n> Some customers integrate single sign-on (SSO) via the user.email value. In the case\n> of one customer I helped, the value is an SSO token used by GitHub for their\n> integration. The token value does not conform to any valid email address format.\n> Adding an email validation will lock them out of using git.\n\nThanks for your reply, Randall.\n\nI've fully understood the scenario you described. My follow-up\nquestion is: was this use case something that was discovered and\nutilized later because people found that Git doesn't validate the\nemail format, or was it a scenario that the architects anticipated\nearly on in the project's history, leading to the deliberate decision\nto skip the validation for flexibility?\n\nIn other words, is this more of a case of \"exploiting a perceived\nbackdoor that later became justified\" or \"a thoughtfully made design\ndecision from the beginning\"?\n\nThanks again for sharing your insight.\n"},{"id":"526212","messageId":"071e01dc2409$f9785230$ec68f690$@nexbridge.com","threadId":"64130","inReplyTo":"CAJKmQvcqLzJDnpYg5K7_eUNCUdLCkkFse-wB+4R8KGxKo_e+0w@mail.gmail.com","subject":"RE: [DISCUSS] validation on git config user.email","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2025-09-12T17:23:31Z","receivedAt":"2025-09-12T17:23:38Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On September 12, 2025 12:52 PM, usharerose wrote:\n>On Fri, Sep 12, 2025 at 11:00 PM <rsbecker@nexbridge.com> wrote:\n>> Some customers integrate single sign-on (SSO) via the user.email\n>> value. In the case of one customer I helped, the value is an SSO token\n>> used by GitHub for their integration. The token value does not conform to any\n>valid email address format.\n>> Adding an email validation will lock them out of using git.\n>\n>Thanks for your reply, Randall.\n>\n>I've fully understood the scenario you described. My follow-up question is: was this\n>use case something that was discovered and utilized later because people found\n>that Git doesn't validate the email format, or was it a scenario that the architects\n>anticipated early on in the project's history, leading to the deliberate decision to skip\n>the validation for flexibility?\n>\n>In other words, is this more of a case of \"exploiting a perceived backdoor that later\n>became justified\" or \"a thoughtfully made design decision from the beginning\"?\n>\n>Thanks again for sharing your insight.\n\nI cannot answer decisively. The functionality was first used in this customer about\nfour years ago. I do not think any changes were required in git to accomplish this.\nIt is possible GitHub had to have an enhancement but only they can answer that.\n\n"},{"id":"526214","messageId":"CAJKmQvcEzs+rhM2+WeFphXqOUD3QGaRGM+yFUkVfKWYpyM3qLQ@mail.gmail.com","threadId":"64130","inReplyTo":"071e01dc2409$f9785230$ec68f690$@nexbridge.com","subject":"Re: [DISCUSS] validation on git config user.email","fromName":"usharerose","fromEmail":"ushareroses@gmail.com","sentAt":"2025-09-12T17:44:41Z","receivedAt":"2025-09-12T17:44:53Z","isPatch":false,"sender":{"key":"ushareroses@gmail.com","avatar":null},"body":"On Sat, Sep 13, 2025 at 1:23 AM <rsbecker@nexbridge.com> wrote:\n> I cannot answer decisively. The functionality was first used in this customer about\n> four years ago. I do not think any changes were required in git to accomplish this.\n> It is possible GitHub had to have an enhancement but only they can answer that.\n\nAppreciate you sharing what you know, Randall. My intention behind the\noriginal question was not to suggest adding validation for email\nlegitimacy, but rather to inquire about and understand the rationale\nbehind the initial design decision to forgo strict validation when the\nuser identity feature (user.email) was implemented.\n\nI will try to find answers from other sources of information.\n\nThank you again for your help.\n"},{"id":"526216","messageId":"CAJKmQvfJVBrmWofs12CAY99HCENASkr1Utjg98TnP7KQ155WNg@mail.gmail.com","threadId":"64130","inReplyTo":"45640ca0-b3c5-4627-b41a-0b58ff559d2b@gmail.com","subject":"Re: [DISCUSS] validation on git config user.email","fromName":"usharerose","fromEmail":"ushareroses@gmail.com","sentAt":"2025-09-12T18:02:58Z","receivedAt":"2025-09-12T18:03:10Z","isPatch":false,"sender":{"key":"ushareroses@gmail.com","avatar":null},"body":"On Fri, Sep 12, 2025 at 11:39 PM Thomas Guyot <tguyot@gmail.com> wrote:\n> To add to the other valid responses, email is something that can be\n> validated by hooks server-side to enforce not only proper formatting but\n> also valid users are being used, ex. validating against an LDAP directory.\n>\n> This is much better that validating it at the command level (although\n> IIRC git-comit does warn about possibly unset/invalid email addresses).\n> In addition, unless git starts enforcing stricter rules on the commit\n> message format (which would be a breaking change), nothing else can\n> prevent someone from constructing commits with invalid emails, so checks\n> by git-commit alone can't be strictly enforceable.\n>\n> Furthermore, imported commits from other SCMs may have odd user\n> name/email and it may be desirable to keep then in their original\n> formats rather than turning them into fake email addresses.\n\nThanks for your detailed reply, Thomas. I've understood the scenarios\nyou mentioned.\n\nMy intention behind the original question was not to suggest adding\nthe feature of validation for email legitimacy, but rather to inquire\nabout and understand the rationale behind the initial design decision\nto forgo strict validation when the user identity feature (user.email)\nwas implemented.\n\nSo, are the use cases above mentioned more of a case of \"exploiting a perceived\nbackdoor that later became justified\" or \"a thoughtfully made design\ndecision from the beginning\"?\n"},{"id":"526217","messageId":"CAJKmQvd1r3NvWKnswHFBf-HJ+H63wBhKF-Q2VABZAbvUXacUQw@mail.gmail.com","threadId":"64130","inReplyTo":"xmqqtt17my71.fsf@gitster.g","subject":"Re: [DISCUSS] validation on git config user.email","fromName":"usharerose","fromEmail":"ushareroses@gmail.com","sentAt":"2025-09-12T18:06:37Z","receivedAt":"2025-09-12T18:06:49Z","isPatch":false,"sender":{"key":"ushareroses@gmail.com","avatar":null},"body":"On Sat, Sep 13, 2025 at 12:29 AM Junio C Hamano <gitster@pobox.com> wrote:\n> That is a very good point.  We need to remember that not all users\n> use the value of the field we define to be \"email\" to send emails\n> to, just like some people use \"name\" field to store something that\n> is not their name.\n\nThanks for your reply, Junio.\n\nMy intention behind the original question was not to suggest adding\nthe feature of validation for email legitimacy, but rather to inquire\nabout and understand the rationale behind the initial design decision\nto forgo strict validation when the user identity feature (user.email)\nwas implemented.\n\nSo, is the case (\"not all users use the value of the field we define\nto be 'email' to send emails to\") more of a case of \"exploiting a\nperceived backdoor that later became justified\" or \"a thoughtfully\nmade design decision from the beginning\"?\n"},{"id":"526271","messageId":"88e9b975-70a5-4773-bd08-634e56c491c6@app.fastmail.com","threadId":"64130","inReplyTo":"071101dc23f5$fbf06e30$f3d14a90$@nexbridge.com","subject":"Re: [DISCUSS] validation on git config user.email","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2025-09-14T11:17:45Z","receivedAt":"2025-09-14T11:18:06Z","isPatch":false,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"On Fri, Sep 12, 2025, at 17:00, rsbecker@nexbridge.com wrote:\n> On September 12, 2025 12:13 AM, usharerose wrote:\n>>I'm a Git user and curious about a specific aspect of Git's design regarding the\n>>'user.email' configuration.\n>>\n>>Git allows any kind of values without restriction when setting 'user.email' via 'git\n>>config' (e.g., `git config user.email \"not-a-valid-email-address\"`).\n>>\n>>I'm interested in understanding the design philosophy or historical reasons behind\n>>this 'lack' of validation.\n>>\n>>I've glanced through the documentations, archived emails, or forum topics, but\n>>couldn't find a definitive or official statement.\n>>\n>>Thanks for your time and insights.\n>\n> Some customers integrate single sign-on (SSO) via the user.email value. \n> In the case\n> of one customer I helped, the value is an SSO token used by GitHub for \n> their\n> integration. The token value does not conform to any valid email \n> address format.\n> Adding an email validation will lock them out of using git.\n\nThat sounds unreasonable.\n"},{"id":"526272","messageId":"62774477-81d2-4959-aa5f-fe0dca023a2a@app.fastmail.com","threadId":"64130","inReplyTo":"CAJKmQvf-sLxowLJLitvqDmyL1BXXDK+anDE2jaBSEabApMNVoQ@mail.gmail.com","subject":"Re: [DISCUSS] validation on git config user.email","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2025-09-14T11:58:17Z","receivedAt":"2025-09-14T11:58:38Z","isPatch":false,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"On Fri, Sep 12, 2025, at 06:13, usharerose wrote:\n> I'm a Git user and curious about a specific aspect of Git's design\n> regarding the 'user.email' configuration.\n>\n> Git allows any kind of values without restriction when setting\n> 'user.email' via 'git config' (e.g., `git config user.email\n> \"not-a-valid-email-address\"`).\n>\n> I'm interested in understanding the design philosophy or historical\n> reasons behind this 'lack' of validation.\n>\n> I've glanced through the documentations, archived emails, or forum\n> topics, but couldn't find a definitive or official statement.\n\nWhat’s the positive case for email validation?\n"},{"id":"526276","messageId":"007701dc2599$02b6ca30$08245e90$@nexbridge.com","threadId":"64130","inReplyTo":"88e9b975-70a5-4773-bd08-634e56c491c6@app.fastmail.com","subject":"RE: [DISCUSS] validation on git config user.email","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2025-09-14T16:59:56Z","receivedAt":"2025-09-14T17:06:21Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On September 14, 2025 7:18 AM, Kristoffer Haugsbakk wrote:\n>On Fri, Sep 12, 2025, at 17:00, rsbecker@nexbridge.com wrote:\n>> On September 12, 2025 12:13 AM, usharerose wrote:\n>>>I'm a Git user and curious about a specific aspect of Git's design\n>>>regarding the 'user.email' configuration.\n>>>\n>>>Git allows any kind of values without restriction when setting\n>>>'user.email' via 'git config' (e.g., `git config user.email\n\"not-a-valid-email-\n>address\"`).\n>>>\n>>>I'm interested in understanding the design philosophy or historical\n>>>reasons behind this 'lack' of validation.\n>>>\n>>>I've glanced through the documentations, archived emails, or forum\n>>>topics, but couldn't find a definitive or official statement.\n>>>\n>>>Thanks for your time and insights.\n>>\n>> Some customers integrate single sign-on (SSO) via the user.email value.\n>> In the case\n>> of one customer I helped, the value is an SSO token used by GitHub for\n>> their integration. The token value does not conform to any valid email\n>> address format.\n>> Adding an email validation will lock them out of using git.\n>\n>That sounds unreasonable.\n\nIn what way, may I ask? I have personally seen this done. Their core.email\nvalue is not a valid user name. It is a token with no @ or . characters. It\nis an alphanumeric string.\n\n"},{"id":"526366","messageId":"CAJKmQvcUQnsgcWW5EgUEaDwZKdtWXnJ1aoVQTAdvG3+te5p1ug@mail.gmail.com","threadId":"64130","inReplyTo":"62774477-81d2-4959-aa5f-fe0dca023a2a@app.fastmail.com","subject":"Re: [DISCUSS] validation on git config user.email","fromName":"usharerose","fromEmail":"ushareroses@gmail.com","sentAt":"2025-09-15T13:40:25Z","receivedAt":"2025-09-15T13:40:38Z","isPatch":false,"sender":{"key":"ushareroses@gmail.com","avatar":null},"body":"On Sun, Sep 14, 2025 at 7:58 PM Kristoffer Haugsbakk\n<kristofferhaugsbakk@fastmail.com> wrote:\n> What’s the positive case for email validation?\n\nThanks for your reply, Kris. My intention behind the original question\nwas not to suggest adding validation for email legitimacy, but rather\nto inquire about and understand the rationale behind the initial\ndesign decision to forgo strict validation when the user identity\nfeature (user.email) was implemented.\n\nI've come across many explanations, but they mostly list the various\napplication scenarios for `user.email` value. I haven't found an\nofficially recognized answer regarding whether the above applications\nwere explicitly considered during the initial design phase. Therefore,\nI would like to consult the official community here.\n\nThank you again for your help.\n"}]}