Skip to content

Provide a useful default user ident on Windows - #45

Closed
dscho wants to merge 3 commits into
gitgitgadget:masterfrom
dscho:default-ident
Closed

dscho wants to merge 3 commits into
gitgitgadget:masterfrom
dscho:default-ident

Conversation

@dscho

@dscho dscho commented Oct 15, 2018 •

Copy link
Copy Markdown
Member

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 dscho mentioned this pull request Oct 15, 2018
35 tasks done
@dscho

dscho commented Oct 15, 2018

Copy link
Copy Markdown
Member Author

/submit

@gitgitgadget

gitgitgadget Bot commented Oct 15, 2018

Copy link
Copy Markdown

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

dscho added 2 commits October 16, 2018 15:06
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>

dscho commented Nov 2, 2018

Copy link
Copy Markdown
Member Author

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

Using the first one.

dscho commented Nov 2, 2018

Copy link
Copy Markdown
Member Author

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

dscho commented Nov 2, 2018

Copy link
Copy Markdown
Member Author

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

dscho commented Nov 2, 2018

Copy link
Copy Markdown
Member Author

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

dscho commented Nov 2, 2018

Copy link
Copy Markdown
Member Author

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

dscho commented Nov 2, 2018

Copy link
Copy Markdown
Member Author

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.

1 participant