jenkinsci / jenkinsci/git-plugin

[JENKINS-63751] Git plugin incorrectly detects changes in PR with merge conflicts

Open
#3,604 1 comment 0 reactions 0 assignees View on GitHub
component:git-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

The PR-187 job and the PR-182 job for the docker-inbound-agent on ci.jenkins.io runs every 30 minutes or 60 minutes and reports that the commit cannot be merged. The git polling log reports:

```
Started on Sep 23, 2020, 12:40:00 AM
Using strategy: SpecificRevisionBuildChooser
[poll] Last Built Revision: Revision 6089fb6c8549de12b90e5af4da82ba5ed9dce3e3 (master)
The recommended git tool is: jgit
No credentials specified
Found 9 remote heads on https://github.com/jenkins-infra/pipeline-library.git
[poll] Latest remote head revision on refs/heads/master is: 368501ef0ff03f3da9468394793cec7032903d68
Using strategy: SpecificRevisionBuildChooser
[poll] Last Built Revision: Revision d017b1219df68e5d70b5f7d256c7ec6762fddd3b (PR-182)
The recommended git tool is: jgit
using credential github-access-token
Found 5 remote heads on https://github.com/jenkinsci/docker-inbound-agent.git
Ignoring refs/heads/jep-15 as it doesn't match any of the configured refspecs
Ignoring refs/heads/slide-patch-1 as it doesn't match any of the configured refspecs
Ignoring refs/heads/alpine as it doesn't match any of the configured refspecs
Ignoring refs/heads/jdk11 as it doesn't match any of the configured refspecs
Using strategy: SpecificRevisionBuildChooser
[poll] Last Built Revision: Revision d017b1219df68e5d70b5f7d256c7ec6762fddd3b (PR-182)
The recommended git tool is: jgit
using credential github-access-token
Found 5 remote heads on https://github.com/jenkinsci/docker-inbound-agent.git
Ignoring refs/heads/jep-15 as it doesn't match any of the configured refspecs
Ignoring refs/heads/slide-patch-1 as it doesn't match any of the configured refspecs
Ignoring refs/heads/alpine as it doesn't match any of the configured refspecs
Ignoring refs/heads/jdk11 as it doesn't match any of the configured refspecs
Using strategy: SpecificRevisionBuildChooser
[poll] Last Built Revision: Revision d017b1219df68e5d70b5f7d256c7ec6762fddd3b (PR-182)
The recommended git tool is: jgit
using credential github-access-token
Found 5 remote heads on https://github.com/jenkinsci/docker-inbound-agent.git
Ignoring refs/heads/jep-15 as it doesn't match any of the configured refspecs
Ignoring refs/heads/slide-patch-1 as it doesn't match any of the configured refspecs
Ignoring refs/heads/alpine as it doesn't match any of the configured refspecs
Ignoring refs/heads/jdk11 as it doesn't match any of the configured refspecs
Done. Took 0.91 sec
Changes found

```

The pipeline definition is a declarative pipeline that looks like this:

```
/* NOTE: this Pipeline mainly aims at catching mistakes (wrongly formed Dockerfile, etc.)
* This Pipeline is *not* used for actual image publishing.
* This is currently handled through Automated Builds using standard Docker Hub feature
*/
pipeline {
agent none

options {
buildDiscarder(logRotator(daysToKeepStr: '10'))
timestamps()
}

triggers {
pollSCM('H/24 * * * *') // once a day in case some hooks are missed
}

stages {
stage('Build Docker Image') {
parallel {
stage('Windows') {
agent {
label 'windock'
}
options {
timeout(time: 60, unit: 'MINUTES')
}
environment {
DOCKERHUB_ORGANISATION = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}"
}
steps {
script {
powershell '& ./make.ps1 test'

def branchName = "${env.BRANCH_NAME}"
if (branchName ==~ 'master') {
// we can't use dockerhub builds for windows
// so we publish here
infra.withDockerCredentials {
powershell '& ./make.ps1 publish'
}
}

def tagName = "${env.TAG_NAME}"
if(tagName =~ /\d(\.\d)+(-\d+)?/) {
// we need to build and publish the tagged version
infra.withDockerCredentials {
powershell "& ./make.ps1 -PushVersions -VersionTag $tagName publish"
}
}

powershell '& docker system prune --force --all'
}
}
}
stage('Linux') {
agent {
label "docker&&linux"
}
options {
timeout(time: 30, unit: 'MINUTES')
}
steps {
script {
if(!infra.isTrusted()) {
deleteDir()
checkout scm
sh '''
make build
make test
docker system prune --force --all
'''
}
}
}
}
}
}
}
}

```

I closed PR-187 and noted to the submitter that it could be reopened once the merge conflict is resolved.

---
Originally reported by markewaite, imported from: Git plugin incorrectly detects changes in PR with merge conflicts


  • status: Open
  • priority: Major
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-02

Raw content of original issue

The PR-187 job and the PR-182 job for the docker-inbound-agent on ci.jenkins.io runs every 30 minutes or 60 minutes and reports that the commit cannot be merged. The git polling log reports:


Started on Sep 23, 2020, 12:40:00 AM

Using strategy: SpecificRevisionBuildChooser
[poll] Last Built Revision: Revision 6089fb6c8549de12b90e5af4da82ba5ed9dce3e3 (master)
The recommended git tool is: jgit
No credentials specified
Found 9 remote heads on https://github.com/jenkins-infra/pipeline-library.git
[poll] Latest remote head revision on refs/heads/master is: 368501ef0ff03f3da9468394793cec7032903d68
Using strategy: SpecificRevisionBuildChooser
[poll] Last Built Revision: Revision d017b1219df68e5d70b5f7d256c7ec6762fddd3b (PR-182)
The recommended git tool is: jgit
using credential github-access-token
Found 5 remote heads on https://github.com/jenkinsci/docker-inbound-agent.git
Ignoring refs/heads/jep-15 as it doesn't match any of the configured refspecs
Ignoring refs/heads/slide-patch-1 as it doesn't match any of the configured refspecs
Ignoring refs/heads/alpine as it doesn't match any of the configured refspecs
Ignoring refs/heads/jdk11 as it doesn't match any of the configured refspecs
Using strategy: SpecificRevisionBuildChooser
[poll] Last Built Revision: Revision d017b1219df68e5d70b5f7d256c7ec6762fddd3b (PR-182)
The recommended git tool is: jgit
using credential github-access-token
Found 5 remote heads on https://github.com/jenkinsci/docker-inbound-agent.git
Ignoring refs/heads/jep-15 as it doesn't match any of the configured refspecs
Ignoring refs/heads/slide-patch-1 as it doesn't match any of the configured refspecs
Ignoring refs/heads/alpine as it doesn't match any of the configured refspecs
Ignoring refs/heads/jdk11 as it doesn't match any of the configured refspecs
Using strategy: SpecificRevisionBuildChooser
[poll] Last Built Revision: Revision d017b1219df68e5d70b5f7d256c7ec6762fddd3b (PR-182)
The recommended git tool is: jgit
using credential github-access-token
Found 5 remote heads on https://github.com/jenkinsci/docker-inbound-agent.git
Ignoring refs/heads/jep-15 as it doesn't match any of the configured refspecs
Ignoring refs/heads/slide-patch-1 as it doesn't match any of the configured refspecs
Ignoring refs/heads/alpine as it doesn't match any of the configured refspecs
Ignoring refs/heads/jdk11 as it doesn't match any of the configured refspecs
Done. Took 0.91 sec
Changes found

The pipeline definition is a declarative pipeline that looks like this:


/* NOTE: this Pipeline mainly aims at catching mistakes (wrongly formed Dockerfile, etc.)

* This Pipeline is *not* used for actual image publishing.
* This is currently handled through Automated Builds using standard Docker Hub feature
*/
pipeline {
agent none

options {
buildDiscarder(logRotator(daysToKeepStr: '10'))
timestamps()
}

triggers {
pollSCM('H/24 * * * *') // once a day in case some hooks are missed
}

stages {
stage('Build Docker Image') {
parallel {
stage('Windows') {
agent {
label 'windock'
}
options {
timeout(time: 60, unit: 'MINUTES')
}
environment {
DOCKERHUB_ORGANISATION = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}"
}
steps {
script {
powershell '& ./make.ps1 test'

def branchName = "${env.BRANCH_NAME}"
if (branchName ==~ 'master') {
// we can't use dockerhub builds for windows
// so we publish here
infra.withDockerCredentials {
powershell '& ./make.ps1 publish'
}
}

def tagName = "${env.TAG_NAME}"
if(tagName =~ /\d(\.\d)+(-\d+)?/) {
// we need to build and publish the tagged version
infra.withDockerCredentials {
powershell "& ./make.ps1 -PushVersions -VersionTag $tagName publish"
}
}

powershell '& docker system prune --force --all'
}
}
}
stage('Linux') {
agent {
label "docker&&linux"
}
options {
timeout(time: 30, unit: 'MINUTES')
}
steps {
script {
if(!infra.isTrusted()) {
deleteDir()
checkout scm
sh '''
make build
make test
docker system prune --force --all
'''
}
}
}
}
}
}
}
}


I closed PR-187 and noted to the submitter that it could be reopened once the merge conflict is resolved.

environment

```
Jenkins 2.249.1

Git plugin 4.4.2

ci.jenkins.io

https://ci.jenkins.io/job/Packaging/job/docker-inbound-agent/job/PR-182/
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.