threads / patch / 22786

patchRe: [PATCH] commit: quote the user name in the example

Subject: Re: [PATCH] commit: quote the user name in the example

## tl;dr

5 messages between Feb 24, 2010 and Feb 24, 2010. Diffs are folded; open one to read it.

replies: 4people: 3as markdown or json

Matt Kraai· Feb 24, 2010, 02:54 UTC · lore

[PATCH] commit: quote the user name in the example

If the user runs
 git config --global user.name Your Name

as suggested, user.name will be set to "Your". With this patch, the suggested command will be

 git config --global user.name 'Your Name'

which will set user.name to "Your Name" and hopefully help users avoid the former mistake.

Signed-off-by: Matt Kraai <kraai@ftbfs.org>
---
 builtin-commit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to builtin-commit.c +1 −1
diff --git a/builtin-commit.c b/builtin-commit.c
index 55676fd..1ec89d1 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -41,7 +41,7 @@ static const char implicit_ident_advice[] =
 "on your username and hostname. Please check that they are accurate.\n"
 "You can suppress this message by setting them explicitly:\n"
 "\n"
-"    git config --global user.name Your Name\n"
+"    git config --global user.name 'Your Name'\n"
 "    git config --global user.email you@example.com\n"
 "\n"
 "If the identity used for this commit is wrong, you can fix it with:\n"
-- 
1.7.0
Johannes Sixt· Feb 24, 2010, 07:49 UTC · re: Matt Kraai · lore
Matt Kraai schrieb:
Show 11 quoted lines
> If the user runs
> 
>  git config --global user.name Your Name
> 
> as suggested, user.name will be set to "Your".  With this patch, the
> suggested command will be
> 
>  git config --global user.name 'Your Name'
> 
> which will set user.name to "Your Name" and hopefully help users avoid
> the former mistake.
Actually, I would prefer that the suggested command is
  git config --global user.name "Your Name"

i.e., with double-quotes, because then the suggestion is also correct for Windows users who run git from CMD: in this environment, single-quotes do not quote, but double-quotes do.

-- Hannes
Matt Kraai· Feb 24, 2010, 14:18 UTC · re: Johannes Sixt · lore

[PATCH] commit: quote the user name in the example

If the user runs
 git config --global user.name Your Name

as suggested, user.name will be set to "Your". With this patch, the suggested command will be

 git config --global user.name "Your Name"

which will set user.name to "Your Name" and hopefully help users avoid the former mistake.

Signed-off-by: Matt Kraai <kraai@ftbfs.org>
---
 builtin-commit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to builtin-commit.c +1 −1
diff --git a/builtin-commit.c b/builtin-commit.c
index 55676fd..46513bf 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -41,7 +41,7 @@ static const char implicit_ident_advice[] =
 "on your username and hostname. Please check that they are accurate.\n"
 "You can suppress this message by setting them explicitly:\n"
 "\n"
-"    git config --global user.name Your Name\n"
+"    git config --global user.name \"Your Name\"\n"
 "    git config --global user.email you@example.com\n"
 "\n"
 "If the identity used for this commit is wrong, you can fix it with:\n"
-- 
1.7.0
Matt Kraai· Feb 24, 2010, 14:19 UTC · re: Johannes Sixt · lore
On Wed, Feb 24, 2010 at 08:49:23AM +0100, Johannes Sixt wrote:
Show 7 quoted lines
> Actually, I would prefer that the suggested command is
> 
>   git config --global user.name "Your Name"
> 
> i.e., with double-quotes, because then the suggestion is also correct for
> Windows users who run git from CMD: in this environment, single-quotes do
> not quote, but double-quotes do.

I've justed submitted a modified version of the patch that uses double-quotes. Thanks for the suggestion.

-- 
Matt                                            http://ftbfs.org/kraai

← back to recent threads