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']]])

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/067e5fc2-b8e9-452f-8ce5-02f6c7ce0f6eo%40googlegroups.com.

Reply via email to