New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the default user name & email logic #487
Conversation
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Cc @lutzroeder |
Git for Windows » git #15 FAILURE |
Oh @buildhive! I tested with Linux locally and it works without problems. That test case is completely unrelated to the changes in this Pull Request, anyway. So I only await the comments of @lutzroeder before merging... |
Personally, I find the name
I guess you're right. I need to use |
We do have the excellent GetUserInfoEx() function to obtain more detailed information of the current user (if the user is part of a Windows domain); Let's use it. Suggested by Lutz Roeder. To avoid the cost of loading Secur32.dll (even lazily, loading DLLs takes a non-neglibile amount of time), we use the established technique to load DLLs only when, and if, needed. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When a user is registered in a Windows domain, it is really easy to obtain the email address. So let's do that. Suggested by Lutz Roeder. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
434bb11
to
662009b
Compare
And now I made it so. @lutzroeder could you have another look, please? |
Looks good |
Improve the default user name & email logic
Thanks! |
Git for Windows » git #17 FAILURE |
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
Improve the default user name & email logic
The concept of using
getpwuid()
is slightly incompatible with the design of the related functions in the Win32 API. While it does have a way to provide the user's display name (which is called "gecos"), there is no POSIX function to obtain the email address of the current user.So let's work a little bit harder to provide sensible defaults.