{"thread":{"id":"12523","subject":"[PATCH] user.default: New config to prevent using the default values for user.*","startedAt":"2008-03-05T19:18:04Z","lastAt":"2008-03-08T02:22:26Z","messageCount":23,"participants":["Santi Béjar","Jon Loeliger","Johannes Schindelin","Daniel Barkalow","Alex Riesen","Jakub Narebski","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"71108","messageId":"1204744684-2043-1-git-send-email-sbejar@gmail.com","threadId":"12523","inReplyTo":null,"subject":"[PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2008-03-05T19:18:04Z","receivedAt":"2008-03-05T19:18:04Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"Useful when you want a different email/name for each repository\n\nSigned-off-by: Santi Béjar <sbejar@gmail.com>\n---\n Documentation/config.txt |    5 +++++\n cache.h                  |    1 +\n config.c                 |    5 +++++\n environment.c            |    1 +\n ident.c                  |    6 +++---\n 5 files changed, 15 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 4027726..d7e5b6d 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -914,6 +914,11 @@ url.<base>.insteadOf::\n \tnever-before-seen repository on the site.  When more than one\n \tinsteadOf strings match a given URL, the longest match is used.\n \n+user.default::\n+\tIf false the defaults values for user.email and user.name are not\n+\tused. Useful when you want a different email/name for each\n+\trepository, normally set in the global config file.\n+\n user.email::\n \tYour email address to be recorded in any newly created commits.\n \tCan be overridden by the 'GIT_AUTHOR_EMAIL', 'GIT_COMMITTER_EMAIL', and\ndiff --git a/cache.h b/cache.h\nindex e230302..70f08d0 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -703,6 +703,7 @@ extern int config_error_nonbool(const char *);\n #define MAX_GITNAME (1000)\n extern char git_default_email[MAX_GITNAME];\n extern char git_default_name[MAX_GITNAME];\n+extern int default_ident;\n \n extern const char *git_commit_encoding;\n extern const char *git_log_output_encoding;\ndiff --git a/config.c b/config.c\nindex 0624494..ea1fa71 100644\n--- a/config.c\n+++ b/config.c\n@@ -445,6 +445,11 @@ int git_default_config(const char *var, const char *value)\n \t\treturn 0;\n \t}\n \n+\tif (!strcmp(var, \"user.default\")) {\n+\t\tdefault_ident = git_config_bool(var, value);\n+\t\treturn 0;\n+\t}\n+\n \tif (!strcmp(var, \"i18n.commitencoding\"))\n \t\treturn git_config_string(&git_commit_encoding, var, value);\n \ndiff --git a/environment.c b/environment.c\nindex 6739a3f..8e252e2 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -11,6 +11,7 @@\n \n char git_default_email[MAX_GITNAME];\n char git_default_name[MAX_GITNAME];\n+int default_ident = 1;\n int trust_executable_bit = 1;\n int quote_path_fully = 1;\n int has_symlinks = 1;\ndiff --git a/ident.c b/ident.c\nindex b839dcf..0f62a94 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -75,7 +75,7 @@ static void setup_ident(void)\n \tstruct passwd *pw = NULL;\n \n \t/* Get the name (\"gecos\") */\n-\tif (!git_default_name[0]) {\n+\tif (!git_default_name[0] && default_ident) {\n \t\tpw = getpwuid(getuid());\n \t\tif (!pw)\n \t\t\tdie(\"You don't exist. Go away!\");\n@@ -88,7 +88,7 @@ static void setup_ident(void)\n \t\tif (email && email[0])\n \t\t\tstrlcpy(git_default_email, email,\n \t\t\t\tsizeof(git_default_email));\n-\t\telse {\n+\t\telse if (default_ident) {\n \t\t\tif (!pw)\n \t\t\t\tpw = getpwuid(getuid());\n \t\t\tif (!pw)\n@@ -171,7 +171,7 @@ static const char au_env[] = \"GIT_AUTHOR_NAME\";\n static const char co_env[] = \"GIT_COMMITTER_NAME\";\n static const char *env_hint =\n \"\\n\"\n-\"*** Your name cannot be determined from your system services (gecos).\\n\"\n+\"*** Your name cannot be determined.\\n\"\n \"\\n\"\n \"Run\\n\"\n \"\\n\"\n-- \n1.5.4.3.447.gc95b3.dirty\n\n"},{"id":"71111","messageId":"47CEFA62.4070209@freescale.com","threadId":"12523","inReplyTo":"1204744684-2043-1-git-send-email-sbejar@gmail.com","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Jon Loeliger","fromEmail":"jdl@freescale.com","sentAt":"2008-03-05T19:54:10Z","receivedAt":"2008-03-05T19:54:10Z","isPatch":true,"sender":{"key":"jdl@jdl.com","avatar":"https://gravatar.com/avatar/75ce9a10b151acd2c28ec4ab2136dba7b2ff1634530bd04b155981a749d08a64?d=mp&s=160"},"body":"Santi Béjar wrote:\n> Useful when you want a different email/name for each repository\n> \n> Signed-off-by: Santi Béjar <sbejar@gmail.com>\n> ---\n>  Documentation/config.txt |    5 +++++\n>  cache.h                  |    1 +\n>  config.c                 |    5 +++++\n>  environment.c            |    1 +\n>  ident.c                  |    6 +++---\n>  5 files changed, 15 insertions(+), 3 deletions(-)\n> \n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index 4027726..d7e5b6d 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -914,6 +914,11 @@ url.<base>.insteadOf::\n>  \tnever-before-seen repository on the site.  When more than one\n>  \tinsteadOf strings match a given URL, the longest match is used.\n>  \n> +user.default::\n> +\tIf false the defaults values for user.email and user.name are not\n\ns/defaults/default\n\n> +\tused. Useful when you want a different email/name for each\n> +\trepository, normally set in the global config file.\n> +\n\nYou already _can_ have a different email/name for each\nrepository, right?  Isn't the issue that you want to _force_\neach repository to explicitly have these values set?\n\njdl\n\n"},{"id":"71112","messageId":"alpine.LSU.1.00.0803052109070.15786@racer.site","threadId":"12523","inReplyTo":"1204744684-2043-1-git-send-email-sbejar@gmail.com","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-03-05T20:11:11Z","receivedAt":"2008-03-05T20:11:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 5 Mar 2008, Santi Béjar wrote:\n\n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index 4027726..d7e5b6d 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -914,6 +914,11 @@ url.<base>.insteadOf::\n>  \tnever-before-seen repository on the site.  When more than one\n>  \tinsteadOf strings match a given URL, the longest match is used.\n>  \n> +user.default::\n> +\tIf false the defaults values for user.email and user.name are not\n> +\tused. Useful when you want a different email/name for each\n> +\trepository, normally set in the global config file.\n> +\n\nI have to wonder: why do you set it in global config file the first place?\n\nAnd the answer...\n\n> diff --git a/ident.c b/ident.c\n> index b839dcf..0f62a94 100644\n> --- a/ident.c\n> +++ b/ident.c\n> @@ -75,7 +75,7 @@ static void setup_ident(void)\n>  \tstruct passwd *pw = NULL;\n>  \n>  \t/* Get the name (\"gecos\") */\n> -\tif (!git_default_name[0]) {\n> +\tif (!git_default_name[0] && default_ident) {\n>  \t\tpw = getpwuid(getuid());\n>  \t\tif (!pw)\n>  \t\t\tdie(\"You don't exist. Go away!\");\n\n... is here.  You are actually not at all talking about the global config \nfile, but the gecos information instead.\n\nCiao,\nDscho\n"},{"id":"71114","messageId":"alpine.LNX.1.00.0803051516300.19665@iabervon.org","threadId":"12523","inReplyTo":"1204744684-2043-1-git-send-email-sbejar@gmail.com","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-03-05T20:21:05Z","receivedAt":"2008-03-05T20:21:05Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Wed, 5 Mar 2008, Santi Béjar wrote:\n\n> Useful when you want a different email/name for each repository\n\nI still think it would be more intuitive if you made it so that setting \nuser.* to nothing was not an error, suppressed picking values up from the \nsystem, and led (if not overridden again) to the message telling you how \nto set them. Is there some reason you decided not to have that be how the \nuser triggers this behavior?\n\n\t-Daniel\n*This .sig left intentionally blank*"},{"id":"71115","messageId":"8aa486160803051236x2e184915hf5d2448a832f4c63@mail.gmail.com","threadId":"12523","inReplyTo":"47CEFA62.4070209@freescale.com","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2008-03-05T20:36:51Z","receivedAt":"2008-03-05T20:36:51Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Wed, Mar 5, 2008 at 8:54 PM, Jon Loeliger <jdl@freescale.com> wrote:\n> Santi Béjar wrote:\n>  > Useful when you want a different email/name for each repository\n>  >\n>  > Signed-off-by: Santi Béjar <sbejar@gmail.com>\n>  > ---\n>  >  Documentation/config.txt |    5 +++++\n>  >  cache.h                  |    1 +\n>  >  config.c                 |    5 +++++\n>  >  environment.c            |    1 +\n>  >  ident.c                  |    6 +++---\n>  >  5 files changed, 15 insertions(+), 3 deletions(-)\n>  >\n>  > diff --git a/Documentation/config.txt b/Documentation/config.txt\n>  > index 4027726..d7e5b6d 100644\n>  > --- a/Documentation/config.txt\n>  > +++ b/Documentation/config.txt\n>  > @@ -914,6 +914,11 @@ url.<base>.insteadOf::\n>  >       never-before-seen repository on the site.  When more than one\n>  >       insteadOf strings match a given URL, the longest match is used.\n>  >\n>  > +user.default::\n>  > +     If false the defaults values for user.email and user.name are not\n>\n>  s/defaults/default\n>\n\nThanks\n\n>\n>  > +     used. Useful when you want a different email/name for each\n>  > +     repository, normally set in the global config file.\n>  > +\n>\n>  You already _can_ have a different email/name for each\n>  repository, right?  Isn't the issue that you want to _force_\n>  each repository to explicitly have these values set?\n>\n\nMaybe:\nUseful when you want a different email/name for each\nrepository, so you can set this in the global config file and then you\nare force to set the user.email and user.name in each repository.\n\n(sorry for my non-native english)\n\nThanks\n\nSanti\n"},{"id":"71117","messageId":"8aa486160803051241y33b69938p6eb68784641672a1@mail.gmail.com","threadId":"12523","inReplyTo":"alpine.LNX.1.00.0803051516300.19665@iabervon.org","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2008-03-05T20:41:33Z","receivedAt":"2008-03-05T20:41:33Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Wed, Mar 5, 2008 at 9:21 PM, Daniel Barkalow <barkalow@iabervon.org> wrote:\n> On Wed, 5 Mar 2008, Santi Béjar wrote:\n>\n>\n> > Useful when you want a different email/name for each repository\n>\n>  I still think it would be more intuitive if you made it so that setting\n>  user.* to nothing was not an error, suppressed picking values up from the\n>  system, and led (if not overridden again) to the message telling you how\n>  to set them. Is there some reason you decided not to have that be how the\n>  user triggers this behavior?\n\nI first tried this way, but when I was writing the documentation I\nfound it more clean and easy if it was a separate config.\n\nSanti\n"},{"id":"71118","messageId":"20080305204414.GB4877@steel.home","threadId":"12523","inReplyTo":"1204744684-2043-1-git-send-email-sbejar@gmail.com","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2008-03-05T20:44:14Z","receivedAt":"2008-03-05T20:44:14Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Santi Béjar, Wed, Mar 05, 2008 20:18:04 +0100:\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -914,6 +914,11 @@ url.<base>.insteadOf::\n>  \tnever-before-seen repository on the site.  When more than one\n>  \tinsteadOf strings match a given URL, the longest match is used.\n>  \n> +user.default::\n> +\tIf false the defaults values for user.email and user.name are not\n\n\"If false the default values\"... An \"s\" in \"default\" was superflous\n\n> @@ -171,7 +171,7 @@ static const char au_env[] = \"GIT_AUTHOR_NAME\";\n>  static const char co_env[] = \"GIT_COMMITTER_NAME\";\n>  static const char *env_hint =\n>  \"\\n\"\n> -\"*** Your name cannot be determined from your system services (gecos).\\n\"\n> +\"*** Your name cannot be determined.\\n\"\n\nWhy not?\n\n"},{"id":"71120","messageId":"m3mypchol6.fsf@localhost.localdomain","threadId":"12523","inReplyTo":"1204744684-2043-1-git-send-email-sbejar@gmail.com","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-03-05T21:01:46Z","receivedAt":"2008-03-05T21:01:46Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Santi Béjar <sbejar@gmail.com> writes:\n\n> Useful when you want a different email/name for each repository\n\n> +user.default::\n> +\tIf false the defaults values for user.email and user.name are not\n> +\tused. Useful when you want a different email/name for each\n> +\trepository, normally set in the global config file.\n> +\n\nWouldn't it be better to use user.noDefault, or user.explicit,\nor user.dontGuess... user.default seems like place to provide\nsome default value, not place to decide if there should be some\nfallback default values or not.\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"71128","messageId":"7vr6eolv0r.fsf@gitster.siamese.dyndns.org","threadId":"12523","inReplyTo":"1204744684-2043-1-git-send-email-sbejar@gmail.com","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-05T21:29:24Z","receivedAt":"2008-03-05T21:29:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Santi Béjar <sbejar@gmail.com> writes:\n\n> +user.default::\n> +\tIf false the defaults values for user.email and user.name are not\n> +\tused. Useful when you want a different email/name for each\n> +\trepository, normally set in the global config file.\n> +\n\nAren't there other configuration variables that you might want\nto tweak per repository?\n\nPerhaps you can make git-init run a post-init hook script by\ndefault, and have ~/.gitconfig specify the location of it, and\nhave it do whatever custom settings to the per-repository\nconfiguration file?\n\nWouldn't that be a more generally useful thing to do, instead of\nadding special-purpose configuration variables like this?\n\nIf we go that alternate route, I would imagine that we would\nneed to add \"--no-post-init\" flag to git-init (and probably an\nenvironment GIT_NO_POST_INIT) so that git-clone and others that\nrun git-init internally can disable the hook if they want to.\n"},{"id":"71135","messageId":"8aa486160803051433h2a5f0aeenaf473784198276f6@mail.gmail.com","threadId":"12523","inReplyTo":"7vr6eolv0r.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2008-03-05T22:33:41Z","receivedAt":"2008-03-05T22:33:41Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Wed, Mar 5, 2008 at 10:29 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Santi Béjar <sbejar@gmail.com> writes:\n>\n>  > +user.default::\n>  > +     If false the defaults values for user.email and user.name are not\n>  > +     used. Useful when you want a different email/name for each\n>  > +     repository, normally set in the global config file.\n>  > +\n>\n>  Aren't there other configuration variables that you might want\n>  to tweak per repository?\n>\n>  Perhaps you can make git-init run a post-init hook script by\n>  default, and have ~/.gitconfig specify the location of it, and\n>  have it do whatever custom settings to the per-repository\n>  configuration file?\n\nI would still need something to prevent doing a commit without a\nlocally specified name/email.\n\nSanti\n"},{"id":"71137","messageId":"8aa486160803051435q1b28ea65o40c5d6ece8a482c6@mail.gmail.com","threadId":"12523","inReplyTo":"m3mypchol6.fsf@localhost.localdomain","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2008-03-05T22:35:48Z","receivedAt":"2008-03-05T22:35:48Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Wed, Mar 5, 2008 at 10:01 PM, Jakub Narebski <jnareb@gmail.com> wrote:\n> Santi Béjar <sbejar@gmail.com> writes:\n>\n>  > Useful when you want a different email/name for each repository\n>\n>\n> > +user.default::\n>  > +     If false the defaults values for user.email and user.name are not\n>  > +     used. Useful when you want a different email/name for each\n>  > +     repository, normally set in the global config file.\n>  > +\n>\n>  Wouldn't it be better to use user.noDefault, or user.explicit,\n>  or user.dontGuess... user.default seems like place to provide\n>  some default value, not place to decide if there should be some\n>  fallback default values or not.\n\nMake sense. I prefer user.explicit.\n\nSanti\n"},{"id":"71141","messageId":"7vwsogkckx.fsf@gitster.siamese.dyndns.org","threadId":"12523","inReplyTo":"8aa486160803051433h2a5f0aeenaf473784198276f6@mail.gmail.com","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-05T22:53:02Z","receivedAt":"2008-03-05T22:53:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Santi Béjar\" <sbejar@gmail.com> writes:\n\n> On Wed, Mar 5, 2008 at 10:29 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n>>  Perhaps you can make git-init run a post-init hook script by\n>>  default, and have ~/.gitconfig specify the location of it, and\n>>  have it do whatever custom settings to the per-repository\n>>  configuration file?\n>\n> I would still need something to prevent doing a commit without a\n> locally specified name/email.\n\nYes, but that something could simply be \"echo '[user] name'\n>.git/config\" in that hook, for example.\n\n\n\n"},{"id":"71145","messageId":"8aa486160803051523t51a8294fwc55d9e41e61cc733@mail.gmail.com","threadId":"12523","inReplyTo":"7vwsogkckx.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2008-03-05T23:23:27Z","receivedAt":"2008-03-05T23:23:27Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Wed, Mar 5, 2008 at 11:53 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> \"Santi Béjar\" <sbejar@gmail.com> writes:\n>\n>  > On Wed, Mar 5, 2008 at 10:29 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>  >\n>\n> >>  Perhaps you can make git-init run a post-init hook script by\n>  >>  default, and have ~/.gitconfig specify the location of it, and\n>  >>  have it do whatever custom settings to the per-repository\n>  >>  configuration file?\n>  >\n>  > I would still need something to prevent doing a commit without a\n>  > locally specified name/email.\n>\n>  Yes, but that something could simply be \"echo '[user] name'\n>  >.git/config\" in that hook, for example.\n\nBut I want a different locally specified name in each repository,\nbecause I use different emails for different projects\n(private/work/...).\n\nSanti\n"},{"id":"71146","messageId":"7v7iggkavd.fsf@gitster.siamese.dyndns.org","threadId":"12523","inReplyTo":"8aa486160803051523t51a8294fwc55d9e41e61cc733@mail.gmail.com","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-05T23:29:58Z","receivedAt":"2008-03-05T23:29:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Santi Béjar\" <sbejar@gmail.com> writes:\n\n>>  > I would still need something to prevent doing a commit without a\n>>  > locally specified name/email.\n>>\n>>  Yes, but that something could simply be \"echo '[user] name'\n>>  >.git/config\" in that hook, for example.\n>\n> But I want a different locally specified name in each repository,\n> because I use different emails for different projects\n> (private/work/...).\n\nYou changed your mind then?  You said you wanted to have something that\nprevents a commit from being made immediately after git-init before\nper-repo user.name is properly configured.  Doesn't that echo achieve that\ngoal?\n\n"},{"id":"71147","messageId":"8aa486160803051539v6813bf98kc0cd0408bb0c65a@mail.gmail.com","threadId":"12523","inReplyTo":"7v7iggkavd.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2008-03-05T23:39:29Z","receivedAt":"2008-03-05T23:39:29Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Thu, Mar 6, 2008 at 12:29 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> \"Santi Béjar\" <sbejar@gmail.com> writes:\n>\n>\n> >>  > I would still need something to prevent doing a commit without a\n>  >>  > locally specified name/email.\n>  >>\n>  >>  Yes, but that something could simply be \"echo '[user] name'\n>  >>  >.git/config\" in that hook, for example.\n>  >\n>  > But I want a different locally specified name in each repository,\n>  > because I use different emails for different projects\n>  > (private/work/...).\n>\n>  You changed your mind then?  You said you wanted to have something that\n>  prevents a commit from being made immediately after git-init before\n>  per-repo user.name is properly configured.  Doesn't that echo achieve that\n>  goal?\n\nBut that was in the context of the initial patch where I said that I\nwanted different name/emails in each repository.\n\nTo summarize, the problem is that I work in different projects\n(private/work/git/...) using the same account, but I want different\nidentifies (name/email) in each. So I set user.name and user.email in\neach repository, but when I forget to set them git uses the default\nones (userid@hostname.(none)).\n\nHope I have explained it well.\n\nSanti\n"},{"id":"71156","messageId":"7v3ar4itk9.fsf@gitster.siamese.dyndns.org","threadId":"12523","inReplyTo":"8aa486160803051539v6813bf98kc0cd0408bb0c65a@mail.gmail.com","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-06T00:29:10Z","receivedAt":"2008-03-06T00:29:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Santi Béjar\" <sbejar@gmail.com> writes:\n\n> On Thu, Mar 6, 2008 at 12:29 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>> \"Santi Béjar\" <sbejar@gmail.com> writes:\n>>\n>> >>  > I would still need something to prevent doing a commit without a\n>>  >>  > locally specified name/email.\n>>  >>\n>>  >>  Yes, but that something could simply be \"echo '[user] name'\n>>  >>  >.git/config\" in that hook, for example.\n>>  >\n>>  > But I want a different locally specified name in each repository,\n>>  > because I use different emails for different projects\n>>  > (private/work/...).\n>>\n>>  You changed your mind then?  You said you wanted to have something that\n>>  prevents a commit from being made immediately after git-init before\n>>  per-repo user.name is properly configured.  Doesn't that echo achieve that\n>>  goal?\n>\n> But that was in the context of the initial patch where I said that I\n> wanted different name/emails in each repository.\n>\n> To summarize, the problem is that I work in different projects\n> (private/work/git/...) using the same account, but I want different\n> identifies (name/email) in each. So I set user.name and user.email in\n> each repository, but when I forget to set them git uses the default\n> ones (userid@hostname.(none)).\n>\n> Hope I have explained it well.\n\nTry:\n\n        $ mkdir -p /var/tmp/junk && cd /var/tmp/junk\n        $ git init\n        $ echo '[user] name' >>.git/config\n        $ >foo\n        $ git add\n\nand tell me what you see.\n\nThat's why I gave you the example of setting \"[user] name\"\n(notice I did not say [user] name = 'Santi's name for this project')\nto force you to configure it to whatever you want.\n"},{"id":"71209","messageId":"8aa486160803060008g4dc3cb8cg6bfce8d2f88461d3@mail.gmail.com","threadId":"12523","inReplyTo":"7v3ar4itk9.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2008-03-06T08:08:09Z","receivedAt":"2008-03-06T08:08:09Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Thu, Mar 6, 2008 at 1:29 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n> \"Santi Béjar\" <sbejar@gmail.com> writes:\n>\n>  > On Thu, Mar 6, 2008 at 12:29 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>  >> \"Santi Béjar\" <sbejar@gmail.com> writes:\n>  >>\n>  >> >>  > I would still need something to prevent doing a commit without a\n>  >>  >>  > locally specified name/email.\n>  >>  >>\n>  >>  >>  Yes, but that something could simply be \"echo '[user] name'\n>  >>  >>  >.git/config\" in that hook, for example.\n>  >>  >\n>  >>  > But I want a different locally specified name in each repository,\n>  >>  > because I use different emails for different projects\n>  >>  > (private/work/...).\n>  >>\n>  >>  You changed your mind then?  You said you wanted to have something that\n>  >>  prevents a commit from being made immediately after git-init before\n>  >>  per-repo user.name is properly configured.  Doesn't that echo achieve that\n>  >>  goal?\n>  >\n>  > But that was in the context of the initial patch where I said that I\n>  > wanted different name/emails in each repository.\n>  >\n>  > To summarize, the problem is that I work in different projects\n>  > (private/work/git/...) using the same account, but I want different\n>  > identifies (name/email) in each. So I set user.name and user.email in\n>  > each repository, but when I forget to set them git uses the default\n>  > ones (userid@hostname.(none)).\n>  >\n>  > Hope I have explained it well.\n>\n>  Try:\n>\n>         $ mkdir -p /var/tmp/junk && cd /var/tmp/junk\n>         $ git init\n>\n>         $ echo '[user] name' >>.git/config\n>         $ >foo\n>         $ git add\n>\n>  and tell me what you see.\n\nEvery single command fails because it no longer a valid git repository.\n\n>\n>  That's why I gave you the example of setting \"[user] name\"\n>  (notice I did not say [user] name = 'Santi's name for this project')\n>  to force you to configure it to whatever you want.\n\nBut then I have to configure in all the repositories, even the ones I\ndo not develop.\n\nSanti\n"},{"id":"71282","messageId":"8aa486160803061345k690af0dcv14fe5d62b310ad6f@mail.gmail.com","threadId":"12523","inReplyTo":"20080305204414.GB4877@steel.home","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2008-03-06T21:45:43Z","receivedAt":"2008-03-06T21:45:43Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Wed, Mar 5, 2008 at 9:44 PM, Alex Riesen <raa.lkml@gmail.com> wrote:\n> Santi Béjar, Wed, Mar 05, 2008 20:18:04 +0100:\n>\n>  > @@ -171,7 +171,7 @@ static const char au_env[] = \"GIT_AUTHOR_NAME\";\n>  >  static const char co_env[] = \"GIT_COMMITTER_NAME\";\n>  >  static const char *env_hint =\n>  >  \"\\n\"\n>  > -\"*** Your name cannot be determined from your system services (gecos).\\n\"\n>  > +\"*** Your name cannot be determined.\\n\"\n>\n>  Why not?\n\nIs this important? Or in another way, is this useful? The important\nthing is how you can fix it. But others think otherwise I'll change it\nto explain the reason.\n\nSanti\n"},{"id":"71357","messageId":"20080307164111.GB4899@steel.home","threadId":"12523","inReplyTo":"8aa486160803061345k690af0dcv14fe5d62b310ad6f@mail.gmail.com","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2008-03-07T16:41:11Z","receivedAt":"2008-03-07T16:41:11Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Santi Béjar, Thu, Mar 06, 2008 22:45:43 +0100:\n> On Wed, Mar 5, 2008 at 9:44 PM, Alex Riesen <raa.lkml@gmail.com> wrote:\n> > Santi Béjar, Wed, Mar 05, 2008 20:18:04 +0100:\n> >\n> >  > @@ -171,7 +171,7 @@ static const char au_env[] = \"GIT_AUTHOR_NAME\";\n> >  >  static const char co_env[] = \"GIT_COMMITTER_NAME\";\n> >  >  static const char *env_hint =\n> >  >  \"\\n\"\n> >  > -\"*** Your name cannot be determined from your system services (gecos).\\n\"\n> >  > +\"*** Your name cannot be determined.\\n\"\n> >\n> >  Why not?\n> \n> Is this important? Or in another way, is this useful? The important\n> thing is how you can fix it. But others think otherwise I'll change it\n> to explain the reason.\n\nIt is precise explanation of what happened. It could be a hint to fix\ngecos field to someone. It is considered useful not to hide\ninformation, even if you have no idea of how useful it is. Others may\nbe smarter than you.\n\nIt could be shortened, thopugh. Maybe remove the asterisks, and\nreplace \"from your system services (gecos)\" with a shorter (but\nprecise) information.\n\n"},{"id":"71389","messageId":"8aa486160803071613pdacc88fkabc10f52da56ad5d@mail.gmail.com","threadId":"12523","inReplyTo":"20080307164111.GB4899@steel.home","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2008-03-08T00:13:18Z","receivedAt":"2008-03-08T00:13:18Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Fri, Mar 7, 2008 at 5:41 PM, Alex Riesen <raa.lkml@gmail.com> wrote:\n> Santi Béjar, Thu, Mar 06, 2008 22:45:43 +0100:\n>\n>\n> > On Wed, Mar 5, 2008 at 9:44 PM, Alex Riesen <raa.lkml@gmail.com> wrote:\n>  > > Santi Béjar, Wed, Mar 05, 2008 20:18:04 +0100:\n>  > >\n>  > >  > @@ -171,7 +171,7 @@ static const char au_env[] = \"GIT_AUTHOR_NAME\";\n>  > >  >  static const char co_env[] = \"GIT_COMMITTER_NAME\";\n>  > >  >  static const char *env_hint =\n>  > >  >  \"\\n\"\n>  > >  > -\"*** Your name cannot be determined from your system services (gecos).\\n\"\n>  > >  > +\"*** Your name cannot be determined.\\n\"\n>  > >\n>  > >  Why not?\n>  >\n>  > Is this important? Or in another way, is this useful? The important\n>  > thing is how you can fix it. But others think otherwise I'll change it\n>  > to explain the reason.\n>\n>  It is precise explanation of what happened. It could be a hint to fix\n>  gecos field to someone. It is considered useful not to hide\n>  information, even if you have no idea of how useful it is.\n\nI'll wait for others to comment.\n\n>  Others may\n>  be smarter than you.\n\nI don't think this is necessary.\n\nSanti\n"},{"id":"71392","messageId":"alpine.LSU.1.00.0803080223030.3975@racer.site","threadId":"12523","inReplyTo":"8aa486160803071613pdacc88fkabc10f52da56ad5d@mail.gmail.com","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-03-08T01:24:29Z","receivedAt":"2008-03-08T01:24:29Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 8 Mar 2008, Santi Béjar wrote:\n\n> On Fri, Mar 7, 2008 at 5:41 PM, Alex Riesen <raa.lkml@gmail.com> wrote:\n> > Santi Béjar, Thu, Mar 06, 2008 22:45:43 +0100:\n> >\n> >\n> > > On Wed, Mar 5, 2008 at 9:44 PM, Alex Riesen <raa.lkml@gmail.com> wrote:\n> >  > > Santi Béjar, Wed, Mar 05, 2008 20:18:04 +0100:\n> >  > >\n> >  > >  > @@ -171,7 +171,7 @@ static const char au_env[] = \"GIT_AUTHOR_NAME\";\n> >  > >  >  static const char co_env[] = \"GIT_COMMITTER_NAME\";\n> >  > >  >  static const char *env_hint =\n> >  > >  >  \"\\n\"\n> >  > >  > -\"*** Your name cannot be determined from your system services (gecos).\\n\"\n> >  > >  > +\"*** Your name cannot be determined.\\n\"\n> >  > >\n> >  > >  Why not?\n> >  >\n> >  > Is this important? Or in another way, is this useful? The important\n> >  > thing is how you can fix it. But others think otherwise I'll change it\n> >  > to explain the reason.\n> >\n> >  It is precise explanation of what happened. It could be a hint to fix\n> >  gecos field to someone. It is considered useful not to hide\n> >  information, even if you have no idea of how useful it is.\n> \n> I'll wait for others to comment.\n\nI thought I asked why you had to remove the comment (which seems not to \nhave a proper reasoning in the commit message), but maybe I did not.\n\nSo here it is in writing: I agree with Alex on the criticism on this part \nof your patch.\n\n> >  Others may be smarter than you.\n> \n> I don't think this is necessary.\n\nIt is not necessary that others may be smarter than you, alright.\n\nHth,\nDscho\n"},{"id":"71397","messageId":"7v7igeynl5.fsf@gitster.siamese.dyndns.org","threadId":"12523","inReplyTo":"alpine.LSU.1.00.0803080223030.3975@racer.site","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-08T02:08:22Z","receivedAt":"2008-03-08T02:08:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Sat, 8 Mar 2008, Santi Béjar wrote:\n>\n>> On Fri, Mar 7, 2008 at 5:41 PM, Alex Riesen <raa.lkml@gmail.com> wrote:\n>> > Santi Béjar, Thu, Mar 06, 2008 22:45:43 +0100:\n>> >\n>> > > On Wed, Mar 5, 2008 at 9:44 PM, Alex Riesen <raa.lkml@gmail.com> wrote:\n>> >  > > Santi Béjar, Wed, Mar 05, 2008 20:18:04 +0100:\n>> >  > >\n>> >  > >  > @@ -171,7 +171,7 @@ static const char au_env[] = \"GIT_AUTHOR_NAME\";\n>> >  > >  >  static const char co_env[] = \"GIT_COMMITTER_NAME\";\n>> >  > >  >  static const char *env_hint =\n>> >  > >  >  \"\\n\"\n>> >  > >  > -\"*** Your name cannot be determined from your system services (gecos).\\n\"\n>> >  > >  > +\"*** Your name cannot be determined.\\n\"\n>> >  > >\n>> >  > >  Why not?\n>> >  >\n>> >  > Is this important? Or in another way, is this useful? The important\n>> >  > thing is how you can fix it. But others think otherwise I'll change it\n>> >  > to explain the reason.\n>> >\n>> >  It is precise explanation of what happened. It could be a hint to fix\n>> >  gecos field to someone. It is considered useful not to hide\n>> >  information, even if you have no idea of how useful it is.\n\nI'd agree with that reasoning on one condition, that is, msysgit folks\nwould adjust this to whatever gecos equivalent is called in the Windows\nworld ;-).\n\nI do not personally think this part of the patch is so bad to waste your\nbrain cells and time arguing about.  I would even suggest removing the\nwhole \"cannot be determined\" and just say \"Please tell me who you are.\"\n\nYes, if you tell people that a lacking GECOS is the underlying reason that\nyou are getting this message, it would hint them an alternative solution\nof talking to their sysadmin to get it fixed, and that one-shot fix will\nlast for all repositories on that machine (and machines that consult the\nsame NIS/LDAP for name information).  However, the \"config --global\"\nsuggested in that message is also a valid one-shot fix, and hopefully\none-shot across machines that NFS mounts the home directories.  The latter\nknowledge can hopefully be reused when you are forced to use git on\nWindows, but the fix based on GECOS would probably not.\n\nSo I'd even argue that Santi's change to the message is an improvement\nthat removes geekspeak that is not particularly useful to the end user\nin this context.\n\nHowever, I would also say that this message improvement does not belong to\nuser.default or whatever the configuration variable is called in this\nround of proposal.  It should be a separate patch, and it would be a much\neasier sell than the rest of the patch series.\n\n"},{"id":"71399","messageId":"alpine.LSU.1.00.0803080321380.3975@racer.site","threadId":"12523","inReplyTo":"7v7igeynl5.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] user.default: New config to prevent using the default values for user.*","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-03-08T02:22:26Z","receivedAt":"2008-03-08T02:22:26Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 7 Mar 2008, Junio C Hamano wrote:\n\n> So I'd even argue that Santi's change to the message is an improvement \n> that removes geekspeak that is not particularly useful to the end user \n> in this context.\n> \n> However, I would also say that this message improvement does not belong \n> to user.default or whatever the configuration variable is called in this \n> round of proposal.  It should be a separate patch, and it would be a \n> much easier sell than the rest of the patch series.\n\nThat was the whole point of Alex' criticism.  I was slightly irritated \nthat his comments elicited a criticism of their own.\n\nSorry for that,\nDscho\n\n"}]}