Details
-
New Feature
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
None
Description
Both accumulated and squashed strategy sets both committer and author to the git user on the Jenkins slave.
The author on the commits on the ready-branch should be kept, as the author on the new commit on the integration branch.
This follows the usual idea of pull-request patterns, where the maintainer accepts the pull requests and becomes the committer, while the original author doing the work get credit as author.
Many repository browsers shows author of commits, thus the history in such systems will be more interesting when looking over the git history. Today it is the git user on the Jenkins slave showing as both committer and author.
If there is more than one commit on the ready branch, the author of the last commit will be used, so in the implementation details we just always use the author of the last commit.
Code changed in jenkins
User: Bue Petersen
Path:
pom.xml
src/main/java/org/jenkinsci/plugins/pretestedintegration/PretestedIntegrationPostCheckout.java
src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/AccumulatedCommitStrategy.java
src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/FindCommitAuthorCallback.java
src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/GitBridge.java
src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/SquashCommitStrategy.java
src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/MultipleScm_threeRepos_IT.java
src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/StaticGitRepositoryTestBase.java
src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/UseAuthorOfLastCommit.java
src/test/resources/useAuthorOfLastCommit-repo_description.log
src/test/resources/useAuthorOfLastCommit.md
src/test/resources/useAuthorOfLastCommit.sh
src/test/resources/useAuthorOfLastCommit.zip
http://jenkins-ci.org/commit/pretested-integration-plugin/79f125e99c537f93cb8a6faf26c805a4859f63a0
Log:
JENKINS-28590Re-use author on commit and refactor:The integration commit will have the author of the last commit on the
development branch being integrated.
In both accumulated and squash strategy the author of the last commit is
collected and used with the '--author' switch during commit of the
integration commit.
The implementation includes large refactoring to improve logging,
console output FIXME
failed to parse java 7 multi catch constructs
Logging changes in general:
lines for consistency
Accumulated and squash strategy implementations:
git command exit codes individually
to set the author of the commit
Finding the author:
GitBridge - the post-build step pushing integration branch and deleting
development branch:
failing
Test MultipleScm_threeRepos_IT:
valid, not only when there is a temporary one and the job is still
building