OK: Blame the operator. shallow: true made the difference. It was shallow: 
false before. So that makes the difference. I'm now getting the desired 
results inside Jenkins.

Randall

On Monday, 3 August 2020 17:13:00 UTC-4, Randall Becker wrote:
>
> I know I should know the answer to this one, but it's eluding me. When I 
> run git describe from within a Jenkins pipeline, I am getting different 
> results from when git describe is run from a normal clone/checkout. This 
> happens even if I move to a detached head state.
>
> Obviously I'm missing an option in the Git clone in Jenkins but I can't 
> figure out what I'm missing. The current checkout is:
>
>                 checkout([$class: 'GitSCM',
>                 changelog: true,
>                 poll: true,
>                 branches: [[name: 'master']],
>                 extensions: [
>                     [$class: 'CleanBeforeCheckout'],
>                     [$class: 'SubmoduleOption', disableSubmodules: false, 
> parentCredentials: true,
>                         recursiveSubmodules: true, reference: '', 
> trackingSubmodules: false]],
>                 doGenerateSubmoduleConfigurations: false, extensions: [
>                     [$class: 'CleanCheckout'],
>                     [$class: 'CloneOption', timeout: 60, shallow: true],
>                     [$class: 'CheckoutOption', timeout: 60],
>                     ],
>                 userRemoteConfigs: [[url: 'git://
> git.samba.org/rsync.git']] <http://git.samba.org/rsync.git'%5D%5D>])
>
> shallow makes no difference - I don't think it's supported anymore, 
> correct?
>
> Inside Jenkins, git describe reports 47351c2b.
> In a standard clone, detached head (or on a branch) at this commit, I get 
> v3.2.3pre1-9-g47351c2b, which is what I'm expecting.
>
> Thanks,
> Randall
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/28e96d92-7e98-41c4-a69d-ec1554d35275o%40googlegroups.com.

Reply via email to