The git plugin defaults to performing a checkout with a detached head at
the SHA1 hash to be built.  There is a plugin option "LocalBranch" which
can assign the name of the local branch to be created at that SHA1.  If
that's not available from the declarative pipeline, you may be able to
perform a "git checkout -b branch_name" in your build step.

Mark Waite

On Sat, Feb 18, 2017 at 11:10 AM Damien Coraboeuf <
damien.corabo...@gmail.com> wrote:

> Hi Mark,
>
> I'm also using the Pipeline Model Definition plug-in, and I think this is
> the culprit in this story. Using the model definition, I do not see any way
> to specify the "checkout scm" (as I would do in a "regular" pipeline
> definition).
>
> I'm using a versioning Gradle plugin and its output shows that we are
> using either a shallow clone or a detached head. I need the target branch
> to be checked out as a local branch.
>
> Best regards,
> Damien.
>
>
> On Sat, Feb 18, 2017 at 7:06 PM, Mark Waite <mark.earl.wa...@gmail.com>
> wrote:
>
> What are you observing that makes you think that shallow clone is always
> enabled?
>
> The git plugin and all my work with GitHub Organization Folders indicates
> that shallow clone is disabled by default for all git plugin usage,
> including GitHub Organization Folders.
>
> I run a GitHub Organization Folder configuration for Jenkins git plugin
> and Jenkins git client plugin development changes from my forks at
> https://github.com/MarkEWaite/git-client-plugin.  If I clone that
> repository with a shallow clone, there are unit tests which fail because
> the tests rely on a full local history of the repository.
>
> Are you performing a "checkout scm" (or similar) in your Jenkinsfile so
> that each job has its own working copy of the repository?  If so, are you
> enabling shallow clone in that checkout?  If not, then you need to change
> to use "checkout scm" in each Jenkinsfile.
>
> Mark Waite
>
> On Sat, Feb 18, 2017 at 10:57 AM Damien Coraboeuf <
> damien.corabo...@gmail.com> wrote:
>
> Hi,
>
> In order to compute versions correctly (using
> https://github.com/nemerosa/versioning), I need my projects not to be
> checked out using a shallow clone option.
>
> The Organization plug-in (
> https://wiki.jenkins-ci.org/display/JENKINS/GitHub+Organization+Folder+Plugin)
> does not seem to allow to disable this option. Or is it something we can
> change using the Pipeline Model Definition plug-in syntax?
>
> Thanks,
> Damien.
>
> --
> 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/69ac8ef3-010a-4a6f-8874-10a4b632dd6d%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/69ac8ef3-010a-4a6f-8874-10a4b632dd6d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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/TIK6DERVZqQ/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/CAO49JtF7Hd1XVatjf5q4caTV6KLmrWTrnK7J7OfjAk9fPcM8yA%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtF7Hd1XVatjf5q4caTV6KLmrWTrnK7J7OfjAk9fPcM8yA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
>
> 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/CAMbUmAEfvgh-nG-Ss49k6Nf69D0f%2Bgbk%2B9UJPyYYe8GY5hMhkw%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CAMbUmAEfvgh-nG-Ss49k6Nf69D0f%2Bgbk%2B9UJPyYYe8GY5hMhkw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> 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/CAO49JtGXv0j7KUWPuXfkFZVPnhfHX%3Dq3Lcz5ckpNrxntKcWuYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to