{"thread":{"id":"8897","subject":"[PATCH] Prefer $EMAIL over auto-generated user@hostname.","startedAt":"2007-07-06T15:03:15Z","lastAt":"2007-07-06T16:23:57Z","messageCount":9,"participants":["Brandon Casey","Uwe Kleine-König","Johannes Schindelin","Alex Riesen","Vincent Hanquez"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"46632","messageId":"468E59B3.7080007@nrlssc.navy.mil","threadId":"8897","inReplyTo":null,"subject":"[PATCH] Prefer $EMAIL over auto-generated user@hostname.","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2007-07-06T15:03:15Z","receivedAt":"2007-07-06T15:03:15Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"\nThis makes $EMAIL the second to last resort ahead of\nusername@hostname rather than the last resort when\nGIT_AUTHOR_EMAIL or GIT_COMMITER_EMAIL and user.email\nare not set.\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n\nLinus Torvalds wrote:\n>If you want it to prefer $EMAIL, you'd need to change the initialization \n>of git_default_email, methinks.\n\nHow about this?\n\n\n ident.c |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/ident.c b/ident.c\nindex 3d49608..dc13510 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -73,6 +73,7 @@ static void copy_email(const struct passwd *pw)\n static void setup_ident(void)\n {\n \tstruct passwd *pw = NULL;\n+        char *email;\n \n \t/* Get the name (\"gecos\") */\n \tif (!git_default_name[0]) {\n@@ -82,6 +83,9 @@ static void setup_ident(void)\n \t\tcopy_gecos(pw, git_default_name, sizeof(git_default_name));\n \t}\n \n+\tif (!git_default_email[0] && (email = getenv(\"EMAIL\")) != NULL)\n+                strlcpy(git_default_email, email, sizeof(git_default_email));\n+\n \tif (!git_default_email[0]) {\n \t\tif (!pw)\n \t\t\tpw = getpwuid(getuid());\n@@ -197,8 +201,6 @@ const char *fmt_ident(const char *name, const char *email,\n \t\tname = git_default_name;\n \tif (!email)\n \t\temail = git_default_email;\n-\tif (!email)\n-\t\temail = getenv(\"EMAIL\");\n \n \tif (!*name) {\n \t\tstruct passwd *pw;\n-- \n1.5.3.rc0.30.g114f-dirty\n"},{"id":"46634","messageId":"20070706151145.GA15341@informatik.uni-freiburg.de","threadId":"8897","inReplyTo":"468E59B3.7080007@nrlssc.navy.mil","subject":"Re: [PATCH] Prefer $EMAIL over auto-generated user@hostname.","fromName":"Uwe Kleine-König","fromEmail":"ukleinek@informatik.uni-freiburg.de","sentAt":"2007-07-06T15:11:45Z","receivedAt":"2007-07-06T15:11:45Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello Brandon,\n\nBrandon Casey wrote:\n>  \tstruct passwd *pw = NULL;\n> +        char *email;\nIndention error. Otherwise it looks good (just from reading the patch).\n\nBest regards\nUwe\n\n-- \nUwe Kleine-König\n\nSet the I_WANT_A_BROKEN_PS environment variable to force BSD syntax ...\n\t-- manpage of procps\n"},{"id":"46637","messageId":"468E5E31.8040504@nrlssc.navy.mil","threadId":"8897","inReplyTo":"20070706151145.GA15341@informatik.uni-freiburg.de","subject":"Re: [PATCH] Prefer $EMAIL over auto-generated user@hostname.","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2007-07-06T15:22:25Z","receivedAt":"2007-07-06T15:22:25Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Uwe Kleine-König wrote:\n> Hello Brandon,\n> \n> Brandon Casey wrote:\n>>  \tstruct passwd *pw = NULL;\n>> +        char *email;\n> Indention error. Otherwise it looks good (just from reading the patch).\n\nhuh. It doesn't look like that in my mail reader.\nI have\n        struct passwd...\n+        char *email;\n\nand the patch applied cleanly when I saved the email and applied it\nusing git-am\n\n  cat git_email.patch | git-am\n\n-brandon\n"},{"id":"46638","messageId":"Pine.LNX.4.64.0707061631560.4093@racer.site","threadId":"8897","inReplyTo":"468E5E31.8040504@nrlssc.navy.mil","subject":"Re: [PATCH] Prefer $EMAIL over auto-generated user@hostname.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-06T15:32:32Z","receivedAt":"2007-07-06T15:32:32Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 6 Jul 2007, Brandon Casey wrote:\n\n> Uwe Kleine-K?nig wrote:\n> > Hello Brandon,\n> > \n> > Brandon Casey wrote:\n> >>  \tstruct passwd *pw = NULL;\n> >> +        char *email;\n> > Indention error. Otherwise it looks good (just from reading the patch).\n> \n> huh. It doesn't look like that in my mail reader.\n> I have\n>         struct passwd...\n> +        char *email;\n> \n> and the patch applied cleanly when I saved the email and applied it\n> using git-am\n> \n>   cat git_email.patch | git-am\n\nYes, it applies cleanly. But it has 8 spaces before \"char *email\", not a \ntab (otherwise it would be lined up with \"struct passwd\").\n\nHth,\nDscho\n"},{"id":"46639","messageId":"468E64F9.9080805@nrlssc.navy.mil","threadId":"8897","inReplyTo":"Pine.LNX.4.64.0707061631560.4093@racer.site","subject":"Re: [PATCH] Prefer $EMAIL over auto-generated user@hostname.","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2007-07-06T15:51:21Z","receivedAt":"2007-07-06T15:51:21Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Johannes Schindelin wrote:\n> Hi,\n> \n> On Fri, 6 Jul 2007, Brandon Casey wrote:\n> \n>> Uwe Kleine-K?nig wrote:\n>>> Hello Brandon,\n>>>\n>>> Brandon Casey wrote:\n>>>>  \tstruct passwd *pw = NULL;\n>>>> +        char *email;\n>>> Indention error. Otherwise it looks good (just from reading the patch).\n>> huh. It doesn't look like that in my mail reader.\n>> I have\n>>         struct passwd...\n>> +        char *email;\n>>\n>> and the patch applied cleanly when I saved the email and applied it\n>> using git-am\n>>\n>>   cat git_email.patch | git-am\n> \n> Yes, it applies cleanly. But it has 8 spaces before \"char *email\", not a \n> tab (otherwise it would be lined up with \"struct passwd\").\n\nAhh. I have expandtab set in .vimrc\nThis wouldn't happen to be part of the war on white space? converting\nspaces to tabs where applicable?\n\nIs the recommended tab stop 8 characters as it is for linux? or 4?\n\n-brandon\n"},{"id":"46643","messageId":"20070706155902.GA17489@snarc.org","threadId":"8897","inReplyTo":"81b0412b0707060859u6a1c3a24p4399a71d84038615@mail.gmail.com","subject":"Re: [PATCH] Prefer $EMAIL over auto-generated user@hostname.","fromName":"Vincent Hanquez","fromEmail":"tab@snarc.org","sentAt":"2007-07-06T15:59:02Z","receivedAt":"2007-07-06T15:59:02Z","isPatch":true,"sender":{"key":"tab@snarc.org","avatar":"https://gravatar.com/avatar/f639df78e7af804fd54c86e32a2b7b1853d3765ba8e66f878e24c933efc30a2a?d=mp&s=160"},"body":"On Fri, Jul 06, 2007 at 05:59:19PM +0200, Alex Riesen wrote:\n> On 7/6/07, Brandon Casey <casey@nrlssc.navy.mil> wrote:\n> >\n> >Is the recommended tab stop 8 characters as it is for linux? or 4?\n> >\n> \n> Tab is always 8 spaces. It is indentation which can be 8, 4, 3, 2, and even \n> 1.\n> It is 8 in Git.\n\ntab isn't 8 spaces. a tab is a tab.\nIt's usually *APPEARING* at 8 spaces. they *may* appears as a different\nsize (to fit anyone preferences), as long as they stay as a tab (not\nexpanded), and that nobody is aligning on tabs.\n\n=> this way the how many spaces should indentation be has no meaning\n   since everybody can choose it on their own terminal/display without\n   setting any value across readers of the code.\n\nCheers,\n-- \nVincent Hanquez\n"},{"id":"46640","messageId":"81b0412b0707060859u6a1c3a24p4399a71d84038615@mail.gmail.com","threadId":"8897","inReplyTo":"468E64F9.9080805@nrlssc.navy.mil","subject":"Re: [PATCH] Prefer $EMAIL over auto-generated user@hostname.","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-06T15:59:19Z","receivedAt":"2007-07-06T15:59:19Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 7/6/07, Brandon Casey <casey@nrlssc.navy.mil> wrote:\n>\n> Is the recommended tab stop 8 characters as it is for linux? or 4?\n>\n\nTab is always 8 spaces. It is indentation which can be 8, 4, 3, 2, and even 1.\nIt is 8 in Git.\n"},{"id":"46644","messageId":"81b0412b0707060922sf0e3c17wcbd55dd65e1c1e14@mail.gmail.com","threadId":"8897","inReplyTo":"20070706155902.GA17489@snarc.org","subject":"Re: [PATCH] Prefer $EMAIL over auto-generated user@hostname.","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-06T16:22:51Z","receivedAt":"2007-07-06T16:22:51Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 7/6/07, Vincent Hanquez <tab@snarc.org> wrote:\n> On Fri, Jul 06, 2007 at 05:59:19PM +0200, Alex Riesen wrote:\n> > On 7/6/07, Brandon Casey <casey@nrlssc.navy.mil> wrote:\n> > >\n> > >Is the recommended tab stop 8 characters as it is for linux? or 4?\n> > >\n> >\n> > Tab is always 8 spaces. It is indentation which can be 8, 4, 3, 2, and even\n> > 1.\n> > It is 8 in Git.\n>\n> tab isn't 8 spaces. a tab is a tab.\n\nOf course. It is used to indent the text to the next position\nwhich multiple of 8.\n\n> It's usually *APPEARING* at 8 spaces. they *may* appears as a different\n> size (to fit anyone preferences), as long as they stay as a tab (not\n> expanded), and that nobody is aligning on tabs.\n>\n> => this way the how many spaces should indentation be has no meaning\n>    since everybody can choose it on their own terminal/display without\n>    setting any value across readers of the code.\n\nThe symbol in question, HT, is used to indent source in the project Git.\n"},{"id":"46645","messageId":"81b0412b0707060923j189f876v96b2c5cd92fd1734@mail.gmail.com","threadId":"8897","inReplyTo":"81b0412b0707060922sf0e3c17wcbd55dd65e1c1e14@mail.gmail.com","subject":"Re: [PATCH] Prefer $EMAIL over auto-generated user@hostname.","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-06T16:23:57Z","receivedAt":"2007-07-06T16:23:57Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 7/6/07, Alex Riesen <raa.lkml@gmail.com> wrote:\n> >\n> > tab isn't 8 spaces. a tab is a tab.\n>\n> Of course. It is used to indent the text to the next position\n> which multiple of 8.\n>\n\nOh, damn... Sorry everyone, for that stupid mail.\nI meant to answer only to Vincent.\n"}]}