Re: Please fix the useless email prompts
Jeff King 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.
Re: Please fix the useless email prompts
On Sun, Aug 20, 2017 at 04:56:50PM -0700, Junio C Hamano wrote: > Andrew Ardill 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
Re: Please fix the useless email prompts
Andrew Ardill 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.
Re: Please fix the useless email prompts
Hi Anatoli, On 21 August 2017 at 07:57, Anatolii Borodin wrote: > On Sun, Aug 20, 2017 at 2:40 PM, Andrew Ardill > 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
Re: Please fix the useless email prompts
Hi Andrew, On Sun, Aug 20, 2017 at 2:40 PM, Andrew Ardill 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
Re: Please fix the useless email prompts
Hi Jeffrey, On Sat, Aug 19, 2017 at 5:10 PM, Jeffrey Walton 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
Re: Please fix the useless email prompts
On 20 August 2017 at 19:18, Jeff King 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-ubxmfrb1glsvjkxhw51whcsbczdh7...@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
Re: Please fix the useless email prompts
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
Re: Please fix the useless email prompts
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-ubxmfrb1glsvjkxhw51whcsbczdh7...@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
Re: Please fix the useless email prompts
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
Re: Please fix the useless email prompts
On Sat, Aug 19, 2017 at 12:36 PM, Junio C Hamano wrote: > Jeffrey Walton 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-ubxmfrb1glsvjkxhw51whcsbczdh7...@mail.gmail.com/ Its 2017. I'd like the tools to work for me instead of me working for the tools. Jeff
Re: Please fix the useless email prompts
Jeffrey Walton 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 "y...@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-ubxmfrb1glsvjkxhw51whcsbczdh7...@mail.gmail.com/