{"thread":{"id":"8902","subject":"[PATCH] Disallow empty GIT_AUTHOR_NAME or GIT_COMMITTER_NAME","startedAt":"2007-07-06T17:50:11Z","lastAt":"2007-07-09T16:41:31Z","messageCount":3,"participants":["Brandon Casey","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"46649","messageId":"468E80D3.5060706@nrlssc.navy.mil","threadId":"8902","inReplyTo":null,"subject":"[PATCH] Disallow empty GIT_AUTHOR_NAME or GIT_COMMITTER_NAME","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2007-07-06T17:50:11Z","receivedAt":"2007-07-06T17:50:11Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Attempt normal methods for determining user name if\nGIT_AUTHOR_NAME or GIT_COMMITTER_NAME is set to the empty\nstring. Then fall back to using the user login name.\n\nPreviously, if these environment variables were set to the\nempty string, a message would be printed complaining about\nmissing gecos information. In this case the gecos information\nwas never checked.\n\nThis still allows an empty GIT_AUTHOR_EMAIL or GIT_COMMITTER_EMAIL.\nPossibly someone would want to use these variables to disable\nthe respective email address string?\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n\n\nTrivial one-liner. I made this patch against master, not\non top of my previous patch. I assume this is the preferred way.\n\nIn case anyone is interested, I am submitting this using thunderbird\nby the following method.\n\nSet thunderbird config variables according to SubmittingPatches doc.\ni.e.:\n   Compose messages in HTML format\n   mailnews.send_plaintext_flowed  => false\n   mailnews.wraplength             => 0\n\nThen I send the patch to myself using git-format-patch and then\ngit-send-email. These two format the patch appropriately for\nsubmission and allow me to set the message-id.\n\nThen I select the message, right-click and choose \"Edit As New...\",\nedit, select the recipients, and send. I also now have a record of\nthe sent message which I would not have if I used only git-send-email.\n\n-brandon\n\n\n ident.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/ident.c b/ident.c\nindex 3d49608..6932ccf 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -193,7 +193,7 @@ const char *fmt_ident(const char *name, const char *email,\n \tint i;\n \n \tsetup_ident();\n-\tif (!name)\n+\tif (!name || !*name)\n \t\tname = git_default_name;\n \tif (!email)\n \t\temail = git_default_email;\n-- \n1.5.3.rc0.30.g114f-dirty\n"},{"id":"46675","messageId":"7vlkdsdaxo.fsf@assigned-by-dhcp.cox.net","threadId":"8902","inReplyTo":"468E80D3.5060706@nrlssc.navy.mil","subject":"Re: [PATCH] Disallow empty GIT_AUTHOR_NAME or GIT_COMMITTER_NAME","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-07T05:45:07Z","receivedAt":"2007-07-07T05:45:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <casey@nrlssc.navy.mil> writes:\n\nBrandon Casey <casey@nrlssc.navy.mil> writes:\n\n> Attempt normal methods for determining user name if\n> GIT_AUTHOR_NAME or GIT_COMMITTER_NAME is set to the empty\n> string. Then fall back to using the user login name.\n>\n> Previously, if these environment variables were set to the\n> empty string, a message would be printed complaining about\n> missing gecos information. In this case the gecos information\n> was never checked.\n>\n> This still allows an empty GIT_AUTHOR_EMAIL or GIT_COMMITTER_EMAIL.\n> Possibly someone would want to use these variables to disable\n> the respective email address string?\n>\n> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n\nThanks.  But this makes me wonder why you do not do the same\ncheck for !*email\n\n> Then I send the patch to myself using git-format-patch and then\n> git-send-email. These two format the patch appropriately for\n> submission and allow me to set the message-id.\n>\n> Then I select the message, right-click and choose \"Edit As New...\",\n> edit, select the recipients, and send. I also now have a record of\n> the sent message which I would not have if I used only git-send-email.\n\nI would just add myself to --bcc when running send-email; much\nsimpler ;-). \n\n>  ident.c |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> diff --git a/ident.c b/ident.c\n> index 3d49608..6932ccf 100644\n> --- a/ident.c\n> +++ b/ident.c\n> @@ -193,7 +193,7 @@ const char *fmt_ident(const char *name, const char *email,\n>  \tint i;\n>  \n>  \tsetup_ident();\n> -\tif (!name)\n> +\tif (!name || !*name)\n>  \t\tname = git_default_name;\n>  \tif (!email)\n>  \t\temail = git_default_email;\n> -- \n> 1.5.3.rc0.30.g114f-dirty\n"},{"id":"46877","messageId":"4692653B.1090803@nrlssc.navy.mil","threadId":"8902","inReplyTo":"7vlkdsdaxo.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Disallow empty GIT_AUTHOR_NAME or GIT_COMMITTER_NAME","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2007-07-09T16:41:31Z","receivedAt":"2007-07-09T16:41:31Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Junio C Hamano wrote:\n> Brandon Casey <casey@nrlssc.navy.mil> writes:\n...\n>> This still allows an empty GIT_AUTHOR_EMAIL or GIT_COMMITTER_EMAIL.\n>> Possibly someone would want to use these variables to disable\n>> the respective email address string?\n>>\n>> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n> \n> Thanks.  But this makes me wonder why you do not do the same\n> check for !*email\n\nI thought someone may want to disable the author or committer email\naddress by setting GIT_AUTHOR_EMAIL or GIT_COMMITTER_EMAIL to an\nempty string. I wasn't sure this was useful that's why I put a '?'\nat the end of my commit message.\n\n\n>> Then I send the patch to myself using git-format-patch and then\n>> git-send-email. These two format the patch appropriately for\n>> submission and allow me to set the message-id.\n>>\n>> Then I select the message, right-click and choose \"Edit As New...\",\n>> edit, select the recipients, and send. I also now have a record of\n>> the sent message which I would not have if I used only git-send-email.\n> \n> I would just add myself to --bcc when running send-email; much\n> simpler ;-). \n\ncurrently I can only use send-email to send email to myself, so this\nwas an alternative to setting up an external editor in thunderbird.\nIt's currently the path of least resistance for me.\n\n-brandon\n"}]}