Git development
 help / color / mirror / Atom feed
* [PATCH] Improved hint on how to set identity
@ 2007-08-13 22:05 Steffen Prohaska
  2007-08-13 23:36 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Steffen Prohaska @ 2007-08-13 22:05 UTC (permalink / raw)
  To: git; +Cc: Steffen Prohaska

Users typically want to set the default for their account. Thus,
start the hint with how to achieve that; and only later explain
how to restrict identity to a single repository.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
 ident.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

I watched someone setting up git, who never used it before.
The hint was leading him into the wrong direction. He
certainly wanted to set a global default. Let's give users
the right hint first.

    Steffen

diff --git a/ident.c b/ident.c
index 6612d17..9b2a852 100644
--- a/ident.c
+++ b/ident.c
@@ -185,11 +185,11 @@ static const char *env_hint =
 "\n"
 "Run\n"
 "\n"
-"  git config user.email \"you@email.com\"\n"
-"  git config user.name \"Your Name\"\n"
+"  git config --global user.email \"you@email.com\"\n"
+"  git config --global user.name \"Your Name\"\n"
 "\n"
-"To set the identity in this repository.\n"
-"Add --global to set your account\'s default\n"
+"to set your account\'s default identity.\n"
+"Omit --global to set the identity only in this repository.\n"
 "\n";
 
 const char *fmt_ident(const char *name, const char *email,
-- 
1.5.3.rc4.96.g6ceb

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Improved hint on how to set identity
  2007-08-13 22:05 [PATCH] Improved hint on how to set identity Steffen Prohaska
@ 2007-08-13 23:36 ` Junio C Hamano
  2007-08-14  5:05   ` Steffen Prohaska
  0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2007-08-13 23:36 UTC (permalink / raw)
  To: Steffen Prohaska; +Cc: git

Steffen Prohaska <prohaska@zib.de> writes:

> Users typically want to set the default for their account. Thus,
> start the hint with how to achieve that; and only later explain
> how to restrict identity to a single repository.

If this were about the introductory part of the user manual, I
would definitely vote for suggesting the --global one first as
the baby steps will be done with one practice/sandbox repository
and then when the user graduates to work on other projects and
possibly under a different identity, it would make sense to
introduce the non global one as an advanced option.

> I watched someone setting up git, who never used it before.
> The hint was leading him into the wrong direction.

Real-life new user experience is a very valuable one.  Can you
elaborate how the hint led in a _wrong_ direction?  What is the
definition of "wrong" here?  It may be that not using --global
is perfectly the correct thing to do.  It really depends on the
project and the situation.

The condition to cause this error message to be shown is
probably a borderline, compared to the earlier "introductory
part of the manual" case.  You may have set an identity in one
repository without global, and then switched to another
repository and saw this message.  In which case you may want to
use a different identity or the same one and I would not say
which one is more common in the case for such a "second
repository".  When you work on two projects, managed by two
different organizations, it often is that you would want
per-repository identity.

Was this the first repository for this person to set up?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Improved hint on how to set identity
  2007-08-13 23:36 ` Junio C Hamano
@ 2007-08-14  5:05   ` Steffen Prohaska
  2007-08-14  5:22     ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Steffen Prohaska @ 2007-08-14  5:05 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git


On Aug 14, 2007, at 1:36 AM, Junio C Hamano wrote:

> Steffen Prohaska <prohaska@zib.de> writes:
>
>> I watched someone setting up git, who never used it before.
>> The hint was leading him into the wrong direction.
>
> Real-life new user experience is a very valuable one.  Can you
> elaborate how the hint led in a _wrong_ direction?  What is the
> definition of "wrong" here?  It may be that not using --global
> is perfectly the correct thing to do.  It really depends on the
> project and the situation.

"wrong" == "more complex", "doing work twice",
            "solving a special case instead of the common case"


> The condition to cause this error message to be shown is
> probably a borderline, compared to the earlier "introductory
> part of the manual" case.  You may have set an identity in one
> repository without global, and then switched to another
> repository and saw this message.  In which case you may want to
> use a different identity or the same one and I would not say
> which one is more common in the case for such a "second
> repository".  When you work on two projects, managed by two
> different organizations, it often is that you would want
> per-repository identity.

maybe... but my feeling is that the majority of people has only
a single identity. Having multiple identities is, in my opinion,
advanced usage, and should be mentioned after the common case.

Would the majority of users want to set up a global identity
or a per repository identity?

Whatever the majority typically needs should be mentioned first.


> Was this the first repository for this person to set up?

It was the first commit.


It would even be a good idea to remove the gecos auto detection
and force _everyone_ to explicitly set the identity on the first
commit. git may derive something from gecos, but often it is
not the correct identity.

I remember when I started, I didn't immediately recognize that
I need to set my identity (or how to do it). Therefore I ended
up with different identities on different machines, because the
information derived from gecos varied. And there's still a
chance that this will happen again. The situation is quite bad,
because it is very hard, if not impossible, to solve later,
after your identity was use to build some history, which may
even have been pushed to the public.

	Steffen

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Improved hint on how to set identity
  2007-08-14  5:05   ` Steffen Prohaska
@ 2007-08-14  5:22     ` Junio C Hamano
  2007-08-14  5:54       ` Steffen Prohaska
  0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2007-08-14  5:22 UTC (permalink / raw)
  To: Steffen Prohaska; +Cc: git

Steffen Prohaska <prohaska@zib.de> writes:

> maybe... but my feeling is that the majority of people has only
> a single identity. Having multiple identities is, in my opinion,
> advanced usage, and should be mentioned after the common case.

My point was that there is nothing that backs up that your
feeling of the majority is correct.  I personally do not have
much preference either way and I certainly do not claim that I
have better feel of what the majority wants than you do.  I just
want to see something more concrete than "I think majority wants
this" to change what has been there for some time.

> I remember when I started, I didn't immediately recognize that
> I need to set my identity (or how to do it). Therefore I ended
> up with different identities on different machines,...

You might want to search the mailing list archive for message
from Linus why he thinks having different per machine identity
for committer field is a good thing.  People have different
taste and needs.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Improved hint on how to set identity
  2007-08-14  5:22     ` Junio C Hamano
@ 2007-08-14  5:54       ` Steffen Prohaska
  2007-08-14  6:32         ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Steffen Prohaska @ 2007-08-14  5:54 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git


On Aug 14, 2007, at 7:22 AM, Junio C Hamano wrote:

> Steffen Prohaska <prohaska@zib.de> writes:
>
>> maybe... but my feeling is that the majority of people has only
>> a single identity. Having multiple identities is, in my opinion,
>> advanced usage, and should be mentioned after the common case.
>
> My point was that there is nothing that backs up that your
> feeling of the majority is correct.  I personally do not have
> much preference either way and I certainly do not claim that I
> have better feel of what the majority wants than you do.  I just
> want to see something more concrete than "I think majority wants
> this" to change what has been there for some time.

I see your point. Yet I do not understand, why people might want
to have _no_ default identity. I think everyone should have a
default identity. That is what my patch does: tell the user to
setup a default account identity first. Per repository identities
can be set up later.

	Steffen

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Improved hint on how to set identity
  2007-08-14  5:54       ` Steffen Prohaska
@ 2007-08-14  6:32         ` Junio C Hamano
  0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2007-08-14  6:32 UTC (permalink / raw)
  To: Steffen Prohaska; +Cc: git

Steffen Prohaska <prohaska@zib.de> writes:

> ... I think everyone should have a
> default identity. That is what my patch does: tell the user to
> setup a default account identity first. Per repository identities
> can be set up later.

Once you put it that way, it makes quite a lot of sense,
although "should" might probably be bit too strong a word.

And it matches how Documentation/tutorial.txt starts out, to
make the suggestions consistent.

Will apply.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-08-14  6:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-13 22:05 [PATCH] Improved hint on how to set identity Steffen Prohaska
2007-08-13 23:36 ` Junio C Hamano
2007-08-14  5:05   ` Steffen Prohaska
2007-08-14  5:22     ` Junio C Hamano
2007-08-14  5:54       ` Steffen Prohaska
2007-08-14  6:32         ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox