Re: Git scm fails to check the expected branch when another branch has the target branch name as a suffix

2019-05-16 Thread James Robson
Using the `checkout` command directly does work. Using that I can specify
'origin/develop' as the branch, and the job is triggering as expected.
Thank You.

On Thu, 16 May 2019 at 15:33, Mark Waite  wrote:

> I don't know if it will help, but you could try replacing the "syntactic
> sugar" command `git` with the `checkout` command.  Pipeline Syntax link on
> the Pipeline pages will help get the correct syntax for the details of the
> checkout command.
>
> On Thu, May 16, 2019 at 7:25 AM James Robson 
> wrote:
>
>>
>>
>> On Wednesday, 15 May 2019 21:28:52 UTC+1, Mark Waite wrote:
>>>
>>>
>>> You can often avoid the guessing by naming the branch precisely, as in
>>> 'origin/develop'.
>>>
>>
>> I attempted to use 'origin/develop' as the branch name, but that causes
>> the job to fail the checkout with "ERROR: Couldn't find any revision to
>> build. Verify the repository and branch configuration for this job". Here's
>> the pipeline I'm testing this with:
>>
>> node('linux') {
>> stage('checkout') {
>> git branch: 'origin/develop', ...
>> }
>> }
>>
>> The last line of output before the failure is a 'git fetch' call which is
>> identical to a run using a branch name of 'develop' which will then
>> checkout successfully.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to jenkinsci-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/f03ac832-bad1-42cb-8840-ce0cb632ae21%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Thanks!
> Mark Waite
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-users/oCeXFei3bZ8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtG%3D8AgjqrXmZpAHBsKPr6Ep7A-ZV%2BEfTGroc46VZB%3DvVg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAD10zustnzcfjORTPBaR%2BSVdsvFbpSzzfJZVAhNED98eWhZrwg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Git scm fails to check the expected branch when another branch has the target branch name as a suffix

2019-05-16 Thread James Robson


On Wednesday, 15 May 2019 21:28:52 UTC+1, Mark Waite wrote:
>
>
> You can often avoid the guessing by naming the branch precisely, as in 
> 'origin/develop'.
>

I attempted to use 'origin/develop' as the branch name, but that causes the 
job to fail the checkout with "ERROR: Couldn't find any revision to build. 
Verify the repository and branch configuration for this job". Here's the 
pipeline I'm testing this with:

node('linux') {
stage('checkout') {
git branch: 'origin/develop', ...
}
}

The last line of output before the failure is a 'git fetch' call which is 
identical to a run using a branch name of 'develop' which will then 
checkout successfully.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f03ac832-bad1-42cb-8840-ce0cb632ae21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Git scm fails to check the expected branch when another branch has the target branch name as a suffix

2019-05-16 Thread Mark Waite
I don't know if it will help, but you could try replacing the "syntactic
sugar" command `git` with the `checkout` command.  Pipeline Syntax link on
the Pipeline pages will help get the correct syntax for the details of the
checkout command.

On Thu, May 16, 2019 at 7:25 AM James Robson 
wrote:

>
>
> On Wednesday, 15 May 2019 21:28:52 UTC+1, Mark Waite wrote:
>>
>>
>> You can often avoid the guessing by naming the branch precisely, as in
>> 'origin/develop'.
>>
>
> I attempted to use 'origin/develop' as the branch name, but that causes
> the job to fail the checkout with "ERROR: Couldn't find any revision to
> build. Verify the repository and branch configuration for this job". Here's
> the pipeline I'm testing this with:
>
> node('linux') {
> stage('checkout') {
> git branch: 'origin/develop', ...
> }
> }
>
> The last line of output before the failure is a 'git fetch' call which is
> identical to a run using a branch name of 'develop' which will then
> checkout successfully.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/f03ac832-bad1-42cb-8840-ce0cb632ae21%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Thanks!
Mark Waite

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtG%3D8AgjqrXmZpAHBsKPr6Ep7A-ZV%2BEfTGroc46VZB%3DvVg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Git scm fails to check the expected branch when another branch has the target branch name as a suffix

2019-05-15 Thread Mark Waite
The git plugin includes support for multiple remotes (origin, upstream,
downstream, etc.) and for multiple branches.  It includes guessing code for
those cases where a branch name is ambiguous (like 'develop' in a
repository which includes branches named 'develop', 'kassandra/develop',
and 'mwaite/develop'). in the context of multiple remotes or multiple
branch names.

You can often avoid the guessing by naming the branch precisely, as in
'origin/develop'.

Mark Waite

On Wed, May 15, 2019 at 1:18 PM James Robson 
wrote:

> I have a repo with a branch called ‘develop’ and another branch called
> ‘kassandra/develop’. I have created a pipeline job that is building on
> ‘develop’, set to trigger with the ‘GitHub hook trigger for GITScm
> polling’.
>
>
> I expect this job to run only when ‘develop’ is changed, however it is
> running on every commit to the repo. This seems to be because the scm
> polling logic is comparing the last built git hash to the git hash on
> ‘kassandra/develop’ (see excerpt of the polling log below).
>
>
> Is this behaviour expected? Is there a way to prevent these unwanted runs?
>
>
> Setup:
>
> Git plugin: 3.9.3
>
> git client plugin: 2.7.6
>
>
> Git poll log:
>
> [poll] Last Built Revision: Revision 576aad8bdbfbf422d6a98899fafe78cc095ebb81
>  (refs/remotes/origin/develop)
> 
> [poll] Latest remote head revision on refs/heads/kassandra/develop is: 
> a9b4791c65f1ed2f1dc5669501fbeee58323e11e
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/b3d3df79-0ab9-4fd8-aeb7-1e70bc2e87ca%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Thanks!
Mark Waite

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtHFeWBYBcgjO9%2BX9HGp_YiaLEEr661-ysf2aFrx1cdgnA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Git scm fails to check the expected branch when another branch has the target branch name as a suffix

2019-05-15 Thread James Robson
 

I have a repo with a branch called ‘develop’ and another branch called 
‘kassandra/develop’. I have created a pipeline job that is building on 
‘develop’, set to trigger with the ‘GitHub hook trigger for GITScm 
polling’. 


I expect this job to run only when ‘develop’ is changed, however it is 
running on every commit to the repo. This seems to be because the scm 
polling logic is comparing the last built git hash to the git hash on 
‘kassandra/develop’ (see excerpt of the polling log below). 


Is this behaviour expected? Is there a way to prevent these unwanted runs?


Setup:

Git plugin: 3.9.3

git client plugin: 2.7.6


Git poll log:

[poll] Last Built Revision: Revision 576aad8bdbfbf422d6a98899fafe78cc095ebb81
 (refs/remotes/origin/develop)

[poll] Latest remote head revision on refs/heads/kassandra/develop is: 
a9b4791c65f1ed2f1dc5669501fbeee58323e11e

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b3d3df79-0ab9-4fd8-aeb7-1e70bc2e87ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.