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

Clarify the consequences of setting user.name and user.email #925

Merged
merged 1 commit into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -934,12 +934,12 @@ image:/images/git-custom-user-name-e-mail-address.png[Custom user name/e-mail ad
user.name::

Defines the user name value which git will assign to new commits made in the workspace.
If given, `git config user.name` is called before builds and overrides values from the global settings.
If given, the environment variables `GIT_COMMITTER_NAME` and `GIT_AUTHOR_NAME` are set for builds and override values from the global settings.

user.email::

Defines the user email value which git will assign to new commits made in the workspace.
If given, `git config user.email` is called before builds and overrides values from the global settings.
If given, the environment variables `GIT_COMMITTER_EMAIL` and `GIT_AUTHOR_EMAIL` are set for builds and override values from the global settings.

[#deprecated-extensions]
=== Deprecated Extensions
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/hudson/plugins/git/GitSCM.java
Original file line number Diff line number Diff line change
Expand Up @@ -1563,31 +1563,31 @@ public String getGitExe() {
}

/**
* Global setting to be used in call to "git config user.name".
* Global setting to be used to set GIT_COMMITTER_NAME and GIT_AUTHOR_NAME.
* @return user.name value
*/
public String getGlobalConfigName() {
return Util.fixEmptyAndTrim(globalConfigName);
}

/**
* Global setting to be used in call to "git config user.name".
* Global setting to be used to set GIT_COMMITTER_NAME and GIT_AUTHOR_NAME.
* @param globalConfigName user.name value to be assigned
*/
public void setGlobalConfigName(String globalConfigName) {
this.globalConfigName = globalConfigName;
}

/**
* Global setting to be used in call to "git config user.email".
* Global setting to be used to set GIT_COMMITTER_EMAIL and GIT_AUTHOR_EMAIL.
* @return user.email value
*/
public String getGlobalConfigEmail() {
return Util.fixEmptyAndTrim(globalConfigEmail);
}

/**
* Global setting to be used in call to "git config user.email".
* Global setting to be used to set GIT_COMMITTER_EMAIL and GIT_AUTHOR_EMAIL.
* @param globalConfigEmail user.email value to be assigned
*/
public void setGlobalConfigEmail(String globalConfigEmail) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div>
<p>If given, "git config user.email [this]" is called before builds. This can be overridden by individual projects.</p>
</div>
<p>If given, "GIT_COMMITTER_EMAIL=[this]" and "GIT_AUTHOR_EMAIL=[this]" are set for builds. This can be overridden by individual projects.</p>
</div>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div>
<p>If given, "git config user.name [this]" is called before builds. This can be overridden by individual projects.</p>
</div>
<p>If given, "GIT_COMMITTER_NAME=[this]" and "GIT_AUTHOR_NAME=[this]" are set for builds. This can be overridden by individual projects.</p>
</div>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div>
<p>If given, "git config user.email [this]" is called before builds. This overrides whatever is in the global settings.</p>
</div>
<p>If given, "GIT_COMMITTER_EMAIL=[this]" and "GIT_AUTHOR_EMAIL=[this]" are set for builds. This overrides whatever is in the global settings.</p>
</div>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div>
<p>If given, "git config user.name [this]" is called before builds. This overrides whatever is in the global settings.</p>
</div>
<p>If given, "GIT_COMMITTER_NAME=[this]" and "GIT_AUTHOR_NAME=[this]" are set for builds. This overrides whatever is in the global settings.</p>
</div>