Skip to content
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

Provide a useful default user ident on Windows #45

Closed
wants to merge 3 commits into from

Conversation

dscho
Copy link
Member

@dscho dscho commented Oct 15, 2018

On Linux, we use the gecos information to come up with a sensible user name/email. On Windows, there is no gecos. But there is something comparable, and with these patches, we use it.

This has been carried in Git for Windows for three years, and is considered mature.

Changes since v1:

  • Removed the static keyword from wbuffer: it does not need to persist.
  • Fixed an off-by-one, where the UTF-8 buffer was allocated without accounting for the trailing NUL byte.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Member Author

dscho commented Oct 15, 2018

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 15, 2018

Submitted as pull.45.git.gitgitgadget@gmail.com

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>
Copy link
Member Author

dscho commented Nov 2, 2018

Found multiple candidates in gitster/git:
refs/remotes/gitster/ds/mingw-default-ident
refs/remotes/gitster/js/mingw-default-ident;

Using the first one.

Copy link
Member Author

dscho commented Nov 2, 2018

This branch is now known as ds/mingw-default-ident.

Copy link
Member Author

dscho commented Nov 2, 2018

This patch series was integrated into pu via git@16ce0b9.

Copy link
Member Author

dscho commented Nov 2, 2018

This patch series was integrated into next via git@16ce0b9.

Copy link
Member Author

dscho commented Nov 2, 2018

This patch series was integrated into master via git@16ce0b9.

Copy link
Member Author

dscho commented Nov 2, 2018

Closed via 16ce0b9.

@dscho dscho deleted the default-ident branch November 2, 2018 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant