git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Please fix the useless email prompts
@ 2017-08-19 15:10 Jeffrey Walton
  2017-08-19 16:36 ` Junio C Hamano
  2017-08-20 21:50 ` Anatolii Borodin
  0 siblings, 2 replies; 13+ messages in thread
From: Jeffrey Walton @ 2017-08-19 15:10 UTC (permalink / raw)
  To: Git List

Is it possible to fix the issue shown below?

I'm on a test machine. All I do is update to the latest code, build
the library and run the self tests.

The test user account does not have a name and does not have an email
address. There's nothing to provide.

There's no reason to break my workflows for useless Git policies like
"please tell me your email address". Its not my policy, and there's
nothing critical about it.

Jeff

**********

$ git pull

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'test@via.(none)')

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

* Re: Please fix the useless email prompts
  2017-08-19 15:10 Please fix the useless email prompts Jeffrey Walton
@ 2017-08-19 16:36 ` Junio C Hamano
  2017-08-19 18:02   ` Jeffrey Walton
  2017-08-20 21:50 ` Anatolii Borodin
  1 sibling, 1 reply; 13+ messages in thread
From: Junio C Hamano @ 2017-08-19 16:36 UTC (permalink / raw)
  To: Jeffrey Walton; +Cc: Git List

Jeffrey Walton <noloader@gmail.com> writes:

> Is it possible to fix the issue shown below?
>
> I'm on a test machine. All I do is update to the latest code, build
> the library and run the self tests.
>
> The test user account does not have a name and does not have an email
> address. There's nothing to provide.
>
> There's no reason to break my workflows for useless Git policies like
> "please tell me your email address". Its not my policy, and there's
> nothing critical about it.
>
> Jeff
>
> **********
>
> $ git pull
>
> *** Please tell me who you are.
>
> Run
>
>   git config --global user.email "you@example.com"
>   git config --global user.name "Your Name"
>
> to set your account's default identity.
> Omit --global to set the identity only in this repository.
>
> fatal: unable to auto-detect email address (got 'test@via.(none)')

Hasn't this been asked and answered already?

    https://public-inbox.org/git/CACBZZX4vEOD-4a-eK-uBxmFrb1GLSvJKxHW51whCSbCZdh7amQ@mail.gmail.com/


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

* Re: Please fix the useless email prompts
  2017-08-19 16:36 ` Junio C Hamano
@ 2017-08-19 18:02   ` Jeffrey Walton
  2017-08-19 19:17     ` Patryk Obara
  2017-08-20  9:18     ` Jeff King
  0 siblings, 2 replies; 13+ messages in thread
From: Jeffrey Walton @ 2017-08-19 18:02 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git List

On Sat, Aug 19, 2017 at 12:36 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Jeffrey Walton <noloader@gmail.com> writes:
>
>> Is it possible to fix the issue shown below?
>>
>> I'm on a test machine. All I do is update to the latest code, build
>> the library and run the self tests.
>>
>> The test user account does not have a name and does not have an email
>> address. There's nothing to provide.
>>
>> There's no reason to break my workflows for useless Git policies like
>> "please tell me your email address". Its not my policy, and there's
>> nothing critical about it.
>>
>> ...
> Hasn't this been asked and answered already?
>
>     https://public-inbox.org/git/CACBZZX4vEOD-4a-eK-uBxmFrb1GLSvJKxHW51whCSbCZdh7amQ@mail.gmail.com/

Its 2017. I'd like the tools to work for me instead of me working for the tools.

Jeff

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

* Re: Please fix the useless email prompts
  2017-08-19 18:02   ` Jeffrey Walton
@ 2017-08-19 19:17     ` Patryk Obara
  2017-08-20  9:18     ` Jeff King
  1 sibling, 0 replies; 13+ messages in thread
From: Patryk Obara @ 2017-08-19 19:17 UTC (permalink / raw)
  To: noloader; +Cc: Git List

Why you can't just set username as name and username@hostname as mail?
You'll do it once and it will be preserved for future. If you use
various accounts for testing, use --system flag for config to store
the values in /etc. If you don't want to modify the environment, use
--local (or no flag) to preserve name in your cloned repository only.

-- 
| ← Ceci n'est pas une pipe
Patryk Obara

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

* Re: Please fix the useless email prompts
  2017-08-19 18:02   ` Jeffrey Walton
  2017-08-19 19:17     ` Patryk Obara
@ 2017-08-20  9:18     ` Jeff King
  2017-08-20 10:19       ` Kaartic Sivaraam
  2017-08-20 12:40       ` Andrew Ardill
  1 sibling, 2 replies; 13+ messages in thread
From: Jeff King @ 2017-08-20  9:18 UTC (permalink / raw)
  To: Jeffrey Walton; +Cc: Junio C Hamano, Git List

On Sat, Aug 19, 2017 at 02:02:09PM -0400, Jeffrey Walton wrote:

> > Hasn't this been asked and answered already?
> >
> >     https://public-inbox.org/git/CACBZZX4vEOD-4a-eK-uBxmFrb1GLSvJKxHW51whCSbCZdh7amQ@mail.gmail.com/
> 
> Its 2017. I'd like the tools to work for me instead of me working for the tools.

Ironically, Git used to behave as you requested in 2005. After being
bombarded with complaints about how Git was too lax in creating commits
with bogus ident information, we changed it in 2012. So I don't think
"it's 2017" carries any weight as an argument.

There are numerous discussions in the archive on this. But my
recollection is that the conclusion is:

  - stricter ident checking on balance saves more headaches than it
    causes, just in terms of numbers

  - the headaches solved by stricter checking are hard to fix (because
    you unknowingly bake cruft into commit objects, and fixing that
    requires a history rewrite)

  - the headaches caused by stricter checking are easy to fix (they're
    obvious when they happen, and "git -c" lets you provide a dummy
    value to override).

We can revisit any of those conclusions, but I'd want to see a
thoughtful discussion of the tradeoffs raised in past rounds, not just
"the current behavior is inconvenient for me".

-Peff

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

* Re: Please fix the useless email prompts
  2017-08-20  9:18     ` Jeff King
@ 2017-08-20 10:19       ` Kaartic Sivaraam
  2017-08-20 12:40       ` Andrew Ardill
  1 sibling, 0 replies; 13+ messages in thread
From: Kaartic Sivaraam @ 2017-08-20 10:19 UTC (permalink / raw)
  To: Jeff King, Jeffrey Walton; +Cc: Junio C Hamano, Git List

On Sun, 2017-08-20 at 05:18 -0400, Jeff King wrote:
> Ironically, Git used to behave as you requested in 2005. After being
> bombarded with complaints about how Git was too lax in creating commits
> with bogus ident information, we changed it in 2012. So I don't think
> "it's 2017" carries any weight as an argument.
> 

I would like to go with the "don't create commits with bogus
ident". "bogus idents" seem to go against the notion of a "content
tracker" which should *help* identifying the user who was the reason
behind the change. It shoudln't encourage users to create "anonymous
changes". Thus an "anonymous user" seems to completely obscure the
meaning of a "content tracker", at least in my opinion

Moreover, there's no tool that can satisfy *all* of it's users because
Humans are so diverse in their thoughts and behaviour.


-- 
Kaartic

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

* Re: Please fix the useless email prompts
  2017-08-20  9:18     ` Jeff King
  2017-08-20 10:19       ` Kaartic Sivaraam
@ 2017-08-20 12:40       ` Andrew Ardill
  2017-08-20 21:57         ` Anatolii Borodin
  1 sibling, 1 reply; 13+ messages in thread
From: Andrew Ardill @ 2017-08-20 12:40 UTC (permalink / raw)
  To: Jeff King; +Cc: Jeffrey Walton, Junio C Hamano, Git List

On 20 August 2017 at 19:18, Jeff King <peff@peff.net> wrote:
> On Sat, Aug 19, 2017 at 02:02:09PM -0400, Jeffrey Walton wrote:
>
>> > Hasn't this been asked and answered already?
>> >
>> >     https://public-inbox.org/git/CACBZZX4vEOD-4a-eK-uBxmFrb1GLSvJKxHW51whCSbCZdh7amQ@mail.gmail.com/
>>
>> Its 2017. I'd like the tools to work for me instead of me working for the tools.
>
> Ironically, Git used to behave as you requested in 2005. After being
> bombarded with complaints about how Git was too lax in creating commits
> with bogus ident information, we changed it in 2012.

Maybe I am missing something obvious, but if that's the case then
can't we just do the identity check when trying to make new commits,
in which case you should be able to pull without setting your
identity?

Regards,

Andrew Ardill

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

* Re: Please fix the useless email prompts
  2017-08-19 15:10 Please fix the useless email prompts Jeffrey Walton
  2017-08-19 16:36 ` Junio C Hamano
@ 2017-08-20 21:50 ` Anatolii Borodin
  1 sibling, 0 replies; 13+ messages in thread
From: Anatolii Borodin @ 2017-08-20 21:50 UTC (permalink / raw)
  To: noloader; +Cc: Git List

Hi Jeffrey,


On Sat, Aug 19, 2017 at 5:10 PM, Jeffrey Walton <noloader@gmail.com> wrote:
> *** Please tell me who you are.

Which version of git do you use? Do you have user.useConfigOnly set to
true anywhere in the config files?

-- 
Mit freundlichen Grüßen,
Anatolii Borodin

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

* Re: Please fix the useless email prompts
  2017-08-20 12:40       ` Andrew Ardill
@ 2017-08-20 21:57         ` Anatolii Borodin
  2017-08-20 23:32           ` Andrew Ardill
  0 siblings, 1 reply; 13+ messages in thread
From: Anatolii Borodin @ 2017-08-20 21:57 UTC (permalink / raw)
  To: Andrew Ardill; +Cc: Jeff King, Jeffrey Walton, Junio C Hamano, Git List

Hi Andrew,

On Sun, Aug 20, 2017 at 2:40 PM, Andrew Ardill <andrew.ardill@gmail.com> wrote:
> Maybe I am missing something obvious, but if that's the case then
> can't we just do the identity check when trying to make new commits,
> in which case you should be able to pull without setting your
> identity?

`git pull` is `git fetch + git merge / git rebase` in disguise, so we
should be ready if git will want to create a merge commit or do a
rebase automatically (and potentially create new commits with
`Committer` set to the current user). `git fetch` and `git clone`
alone, `git branch`, `git checkout` etc don't care about the email (as
of 2.14.1), even if `user.useConfigOnly` is set to `true`.


-- 
Mit freundlichen Grüßen,
Anatolii Borodin

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

* Re: Please fix the useless email prompts
  2017-08-20 21:57         ` Anatolii Borodin
@ 2017-08-20 23:32           ` Andrew Ardill
  2017-08-20 23:56             ` Junio C Hamano
  0 siblings, 1 reply; 13+ messages in thread
From: Andrew Ardill @ 2017-08-20 23:32 UTC (permalink / raw)
  To: Anatolii Borodin; +Cc: Jeff King, Jeffrey Walton, Junio C Hamano, Git List

Hi Anatoli,

On 21 August 2017 at 07:57, Anatolii Borodin <anatoly.borodin@gmail.com> wrote:
> On Sun, Aug 20, 2017 at 2:40 PM, Andrew Ardill <andrew.ardill@gmail.com> wrote:
>> Maybe I am missing something obvious, but if that's the case then
>> can't we just do the identity check when trying to make new commits,
>> in which case you should be able to pull without setting your
>> identity?
>
> `git pull` is `git fetch + git merge / git rebase` in disguise, so we
> should be ready if git will want to create a merge commit or do a
> rebase automatically (and potentially create new commits with
> `Committer` set to the current user). `git fetch` and `git clone`
> alone, `git branch`, `git checkout` etc don't care about the email (as
> of 2.14.1), even if `user.useConfigOnly` is set to `true`.

Is there any reason `git pull` can't delay that check until the point
where it actually tries to create a new commit? It's fair enough to
error if a new commit needs to be made, and there is no user
configured, but for the use cases discussed here it seems a little
eager to error on the chance that the user will be needed.

It seems nicer for the user if the `git fetch` happens first, and if
the merge is not a fast forward, and there is no user configured, that
the error pops then. I don't know if this idea of "do as much as
possible before erroring" is consistent with any other errors we
handle.

Regards,

Andrew Ardill

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

* Re: Please fix the useless email prompts
  2017-08-20 23:32           ` Andrew Ardill
@ 2017-08-20 23:56             ` Junio C Hamano
  2017-08-23 15:35               ` Jeff King
  0 siblings, 1 reply; 13+ messages in thread
From: Junio C Hamano @ 2017-08-20 23:56 UTC (permalink / raw)
  To: Andrew Ardill; +Cc: Anatolii Borodin, Jeff King, Jeffrey Walton, Git List

Andrew Ardill <andrew.ardill@gmail.com> writes:

> Is there any reason `git pull` can't delay that check until the point
> where it actually tries to create a new commit? It's fair enough to
> error if a new commit needs to be made, and there is no user
> configured, but for the use cases discussed here it seems a little
> eager to error on the chance that the user will be needed.

I personally do not think it is a good trade-off.

In theory [*1*], it _is_ possible to delay the "the given identity
looks bogus" check so that the underlying "git fetch" is done
without it, and bypass the check when "pull" fast-forwards, as there
is no need for an extra merge commit in such a case as you noticed.
We still do record the bogus identity in the reflog of the HEAD ref,
but IIRC, we do not trigger a severe error when a bogus identity is
only needed for reflogs.

But before running "fetch", you cannot tell if the "pull" will
fast-forward, so such an "optimization" may actually be a net loss
for end users, who have to wait for network delay only to be told
that you'd end up with a history with bogus identity and need to
redo the operation after fixing your identity.  Then after that,
they are likely to do another "git pull", which will avoid the cost
of retransmission of objects if (and only if) the initial "git pull"
uses remote-tracking branches.


[Footnote]

*1* We actually might already do such an "optimization"; I didn't
    check.

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

* Re: Please fix the useless email prompts
  2017-08-20 23:56             ` Junio C Hamano
@ 2017-08-23 15:35               ` Jeff King
  2017-08-23 17:36                 ` Junio C Hamano
  0 siblings, 1 reply; 13+ messages in thread
From: Jeff King @ 2017-08-23 15:35 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Andrew Ardill, Anatolii Borodin, Jeffrey Walton, Git List

On Sun, Aug 20, 2017 at 04:56:50PM -0700, Junio C Hamano wrote:

> Andrew Ardill <andrew.ardill@gmail.com> writes:
> 
> > Is there any reason `git pull` can't delay that check until the point
> > where it actually tries to create a new commit? It's fair enough to
> > error if a new commit needs to be made, and there is no user
> > configured, but for the use cases discussed here it seems a little
> > eager to error on the chance that the user will be needed.
> 
> I personally do not think it is a good trade-off.
> 
> In theory [*1*],
> [...]
> *1* We actually might already do such an "optimization"; I didn't
>     check.

I think we already do. Reflogs do not ask for strict identity, and we've
addressed similar cases (e.g., 1e461c4f1fc which was motivated by
pull.rebase not handling this).

> But before running "fetch", you cannot tell if the "pull" will
> fast-forward, so such an "optimization" may actually be a net loss
> for end users, who have to wait for network delay only to be told
> that you'd end up with a history with bogus identity and need to
> redo the operation after fixing your identity.  Then after that,
> they are likely to do another "git pull", which will avoid the cost
> of retransmission of objects if (and only if) the initial "git pull"
> uses remote-tracking branches.

I agree that in the common case where the command might or might not
need to create a commit, it's nicer if we tell the user up front.

But there are also cases where the user can reasonably expect that a
commit will not need to be created. Certainly --ff-only is one hint. But
in general a pull-only repository for testing will just see repeated
fetch+fast-forward pulls. People with that kind of setup would see it as
a regression if pull started failing to say "I don't know yet whether
we'll need to create a commit, but I'm failing early to let you know
that it won't work".

If we could reliably tell the difference between those two cases, it
might be worth doing the up-front check. But I'm not sure we can do that
without declaring that people in the ff-only case should be using a
different workflow (e.g., fetch + "reset --hard").

-Peff

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

* Re: Please fix the useless email prompts
  2017-08-23 15:35               ` Jeff King
@ 2017-08-23 17:36                 ` Junio C Hamano
  0 siblings, 0 replies; 13+ messages in thread
From: Junio C Hamano @ 2017-08-23 17:36 UTC (permalink / raw)
  To: Jeff King; +Cc: Andrew Ardill, Anatolii Borodin, Jeffrey Walton, Git List

Jeff King <peff@peff.net> writes:

> If we could reliably tell the difference between those two cases, it
> might be worth doing the up-front check. But I'm not sure we can do that
> without declaring that people in the ff-only case should be using a
> different workflow (e.g., fetch + "reset --hard").

Yup, it _might_ be nicer but I tend to think probably it is not
worth the potential trouble.

Thanks.

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

end of thread, other threads:[~2017-08-23 17:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-19 15:10 Please fix the useless email prompts Jeffrey Walton
2017-08-19 16:36 ` Junio C Hamano
2017-08-19 18:02   ` Jeffrey Walton
2017-08-19 19:17     ` Patryk Obara
2017-08-20  9:18     ` Jeff King
2017-08-20 10:19       ` Kaartic Sivaraam
2017-08-20 12:40       ` Andrew Ardill
2017-08-20 21:57         ` Anatolii Borodin
2017-08-20 23:32           ` Andrew Ardill
2017-08-20 23:56             ` Junio C Hamano
2017-08-23 15:35               ` Jeff King
2017-08-23 17:36                 ` Junio C Hamano
2017-08-20 21:50 ` Anatolii Borodin

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).