-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Jenkins 1.509.4, Git plugin 2.0, Git client plugin 1.4.6, Debian Linux 7.2 ("Wheezy"), JDK 1.7.0u45 x64
If I use the jgit implementation in a job which should merge from multiple branches, the merge result is not pushed back to origin. Merge result is pushed if I use the command line implementation in the same job.
Steps to duplicate the problem (with apologies for the number of steps)
- Create a bare git repo on the master node as Jenkins user
- rm -rf /tmp/changes.git /tmp/changes
- git init --bare /tmp/changes.git
- echo "#! /bin/sh" > /tmp/changes.git/hooks/post-receive
- echo "curl --silent http://127.0.0.1:8080/git/notifyCommit?url=/tmp/changes.git" >> /tmp/changes.git/hooks/post-receive
- chmod a+x /tmp/changes.git/hooks/post-receive
- cd /tmp
- git clone changes.git
- cd changes
- echo "Git plugin 2.0 no longer shows changes from merges" > README
- git add README
- git commit -m "Add README to describe this repository" README
- git push origin master
- Create a Jenkins merge job using that bare git repo
- Create a new free-style software project "merge-changes"
- Restrict where this project can be run
- Label Expression: master
- Git source code management settings
- Use jgit rather than default
- Repository URL: /tmp/changes.git
- Branches to build: */master*
- Additional behaviors: Merge before build
- Name of repository: origin
- (error on merge if this is blank - help says should use default, but didn't)
- Branch to merge to: master
- Name of repository: origin
- Poll SCM (for convenience with the git hook installed earlier)
- H * * * *
- Add post-build action: Git Publisher
- Git Publisher settings
- Merge results: Yes
- Branches:
- Branches to push: master
- Target remote name: origin
- Git Publisher settings
- Save the job
- Build Jenkins job
- curl --silent http://127.0.0.1:8080/job/merge-changes/build?delay=0sec
- Create new master-add-timestamp branch and commit from it
- git checkout -b master-add-timestamp
- date >> timestamp
- git add timestamp
- git commit -m "Add timestamp" timestamp
- git push origin master-add-timestamp
- Jenkins job runs
- Confirm master branch did not receive the merge result
- git checkout master
- git pull
- git log
- is duplicated by
-
JENKINS-29271 Git Publisher doesn't PUSH if JGit is used
-
- Closed
-
-
JENKINS-25797 jgit is not pushing branch in git publisher
-
- Closed
-
[JENKINS-20393] Git plugin 2.0 JGit implementation does not publish merge result
Description |
Original:
The "Recent Changes" list in merge jobs which use the Git plugin are now empty. Prior to Git plugin 2.0, the "Recent Changes" list showed those changes whose merge was attempted, whether the merge succeeded or not Steps to duplicate the problem (with apologies for the number of steps) # Create a bare git repo on the master node as Jenkins user ## {{rm -rf /tmp/changes.git /tmp/changes}} ## {{git init --bare /tmp/changes.git}} ## {{echo "#! /bin/sh" > /tmp/changes.git/hooks/post-receive}} ## echo "curl --silent http://127.0.0.1:8080/git/notifyCommit?url=/tmp/changes.git\" >> /tmp/changes.git/hooks/post-receive ## {{chmod a+x /tmp/changes.git/hooks/post-receive}} ## {{cd /tmp}} ## {{git clone changes.git}} ## {{cd changes}} ## {{echo "Git plugin 2.0 no longer shows changes from merges" > README}} ## {{git add README}} ## {{git commit -m "Add README to describe this repository" README}} ## {{git push origin master}} # Create a Jenkins merge job using that bare git repo ## Create a new free-style software project "merge-changes" ## Restrict where this project can be run ### Label Expression: master ## Git source code management settings ### Repository URL: /tmp/changes.git ### Branches to build: \*/master\* ## Additional behaviors: Merge before build ### Name of repository: origin #### (error on merge if this is blank - help says should use default, but didn't) ### Branch to merge to: master ## Poll SCM (for convenience with the git hook installed earlier) ### H * * * * ## Add post-build action: Git Publisher ### Git Publisher settings #### Merge results: Yes #### Branches: ##### Branches to push: master ##### Target remote name: origin ## Save the job # Build Jenkins job ## curl --silent http://127.0.0.1:8080/job/merge-changes/build?delay=0sec ### Note that the "Recent Changes" will report no changes in any build # Create new master-add-timestamp branch and commit from it ## {{git checkout -b master-add-timestamp}} ## {{date >> timestamp}} ## {{git add timestamp}} ## {{git commit -m "Add timestamp" timestamp}} ## {{git push origin master-add-timestamp}} # Jenkins job runs, but "Recent Changes" still reports "No changes in any of the builds" # Confirm master branch received the merge result ## {{git checkout master}} ## {{git pull}} # Create new master-add-timestamp2 branch and commit from it ## {{git checkout -b master-add-timestamp2}} ## {{date >> timestamp2}} ## {{git add timestamp2}} ## {{git commit -m "Add new timestamp2" timestamp2}} ## {{git push origin master-add-timestamp2}} ## BUG: Merge will happen and be pushed, but no change listed # Confirm master branch received the merge result ## {{git checkout master}} ## {{git pull}} |
New:
If I use the jgit implementation in a job which should merge from multiple branches, the merge result is not pushed back to origin. Merge result is pushed if I use the command line implementation in the same job. Steps to duplicate the problem (with apologies for the number of steps) # Create a bare git repo on the master node as Jenkins user ## {{rm -rf /tmp/changes.git /tmp/changes}} ## {{git init --bare /tmp/changes.git}} ## {{echo "#! /bin/sh" > /tmp/changes.git/hooks/post-receive}} ## echo "curl --silent http://127.0.0.1:8080/git/notifyCommit?url=/tmp/changes.git\" >> /tmp/changes.git/hooks/post-receive ## {{chmod a+x /tmp/changes.git/hooks/post-receive}} ## {{cd /tmp}} ## {{git clone changes.git}} ## {{cd changes}} ## {{echo "Git plugin 2.0 no longer shows changes from merges" > README}} ## {{git add README}} ## {{git commit -m "Add README to describe this repository" README}} ## {{git push origin master}} # Create a Jenkins merge job using that bare git repo ## Create a new free-style software project "merge-changes" ## Restrict where this project can be run ### Label Expression: master ## Git source code management settings ### Use jgit rather than default ### Repository URL: /tmp/changes.git ### Branches to build: \*/master\* ## Additional behaviors: Merge before build ### Name of repository: origin #### (error on merge if this is blank - help says should use default, but didn't) ### Branch to merge to: master ## Poll SCM (for convenience with the git hook installed earlier) ### H * * * * ## Add post-build action: Git Publisher ### Git Publisher settings #### Merge results: Yes #### Branches: ##### Branches to push: master ##### Target remote name: origin ## Save the job # Build Jenkins job ## curl --silent http://127.0.0.1:8080/job/merge-changes/build?delay=0sec # Create new master-add-timestamp branch and commit from it ## {{git checkout -b master-add-timestamp}} ## {{date >> timestamp}} ## {{git add timestamp}} ## {{git commit -m "Add timestamp" timestamp}} ## {{git push origin master-add-timestamp}} # Jenkins job runs # Confirm master branch did not receive the merge result ## {{git checkout master}} ## {{git pull}} ## {{git log}} |
Description |
Original:
If I use the jgit implementation in a job which should merge from multiple branches, the merge result is not pushed back to origin. Merge result is pushed if I use the command line implementation in the same job. Steps to duplicate the problem (with apologies for the number of steps) # Create a bare git repo on the master node as Jenkins user ## {{rm -rf /tmp/changes.git /tmp/changes}} ## {{git init --bare /tmp/changes.git}} ## {{echo "#! /bin/sh" > /tmp/changes.git/hooks/post-receive}} ## echo "curl --silent http://127.0.0.1:8080/git/notifyCommit?url=/tmp/changes.git\" >> /tmp/changes.git/hooks/post-receive ## {{chmod a+x /tmp/changes.git/hooks/post-receive}} ## {{cd /tmp}} ## {{git clone changes.git}} ## {{cd changes}} ## {{echo "Git plugin 2.0 no longer shows changes from merges" > README}} ## {{git add README}} ## {{git commit -m "Add README to describe this repository" README}} ## {{git push origin master}} # Create a Jenkins merge job using that bare git repo ## Create a new free-style software project "merge-changes" ## Restrict where this project can be run ### Label Expression: master ## Git source code management settings ### Use jgit rather than default ### Repository URL: /tmp/changes.git ### Branches to build: \*/master\* ## Additional behaviors: Merge before build ### Name of repository: origin #### (error on merge if this is blank - help says should use default, but didn't) ### Branch to merge to: master ## Poll SCM (for convenience with the git hook installed earlier) ### H * * * * ## Add post-build action: Git Publisher ### Git Publisher settings #### Merge results: Yes #### Branches: ##### Branches to push: master ##### Target remote name: origin ## Save the job # Build Jenkins job ## curl --silent http://127.0.0.1:8080/job/merge-changes/build?delay=0sec # Create new master-add-timestamp branch and commit from it ## {{git checkout -b master-add-timestamp}} ## {{date >> timestamp}} ## {{git add timestamp}} ## {{git commit -m "Add timestamp" timestamp}} ## {{git push origin master-add-timestamp}} # Jenkins job runs # Confirm master branch did not receive the merge result ## {{git checkout master}} ## {{git pull}} ## {{git log}} |
New:
If I use the jgit implementation in a job which should merge from multiple branches, the merge result is not pushed back to origin. Merge result is pushed if I use the command line implementation in the same job. Steps to duplicate the problem (with apologies for the number of steps) # Create a bare git repo on the master node as Jenkins user ## {{rm -rf /tmp/changes.git /tmp/changes}} ## {{git init --bare /tmp/changes.git}} ## {{echo "#! /bin/sh" > /tmp/changes.git/hooks/post-receive}} ## echo "curl --silent http://127.0.0.1:8080/git/notifyCommit?url=/tmp/changes.git" >> /tmp/changes.git/hooks/post-receive ## {{chmod a+x /tmp/changes.git/hooks/post-receive}} ## {{cd /tmp}} ## {{git clone changes.git}} ## {{cd changes}} ## {{echo "Git plugin 2.0 no longer shows changes from merges" > README}} ## {{git add README}} ## {{git commit -m "Add README to describe this repository" README}} ## {{git push origin master}} # Create a Jenkins merge job using that bare git repo ## Create a new free-style software project "merge-changes" ## Restrict where this project can be run ### Label Expression: master ## Git source code management settings ### Use jgit rather than default ### Repository URL: /tmp/changes.git ### Branches to build: \*/master\* ## Additional behaviors: Merge before build ### Name of repository: origin #### (error on merge if this is blank - help says should use default, but didn't) ### Branch to merge to: master ## Poll SCM (for convenience with the git hook installed earlier) ### H * * * * ## Add post-build action: Git Publisher ### Git Publisher settings #### Merge results: Yes #### Branches: ##### Branches to push: master ##### Target remote name: origin ## Save the job # Build Jenkins job ## curl --silent http://127.0.0.1:8080/job/merge-changes/build?delay=0sec # Create new master-add-timestamp branch and commit from it ## {{git checkout -b master-add-timestamp}} ## {{date >> timestamp}} ## {{git add timestamp}} ## {{git commit -m "Add timestamp" timestamp}} ## {{git push origin master-add-timestamp}} # Jenkins job runs # Confirm master branch did not receive the merge result ## {{git checkout master}} ## {{git pull}} ## {{git log}} |
Link |
New:
This issue is duplicated by |
Assignee | Original: Nicolas De Loof [ ndeloof ] |
Link |
New:
This issue is duplicated by |
Confirmed still an issue with git client plugin 1.10.1 and git plugin 2.2.4.