There isn't an API in the git-client-plugin today that will allow you to
access the list of tags in a repository without a workspace.

It seems like it should be possible to do that, since "git ls-remote
--tags" will list the tags of the remote repository, and the
git-client-plugin already has calls which use git ls-remote to retrieve the
list of available head revisions (getHeadRev()).

It seems like a new form of getTagNames() would be needed, with an argument
for the remote repository URL.  There are two implementations of
getTagNames currently, one for the command line git implementation and one
for the JGit implementation.  There are unit tests around that method, so
it should be a reasonably safe place for you to submit a pull request to
add that new form of getTagNames().

Mark Waite


On Sat, May 3, 2014 at 11:17 AM, Niklaus Giger <[email protected]>wrote:

> Hi
>
> I am trying to fix an issue with the git-parameter plugin (using
> https://github.com/jenkinsci/git-parameter-plugin/tree/preview_0_3).
>
> Listing/sorting the tags work fine if I have a workspace. After deleting
> the workspace the tags are no longer listed an I find the following error
> in my jenkins.log
> Caused by: hudson.plugins.git.GitException: Error retrieving tag names
>         at
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getTagNames(CliGitAPIImpl.java:1699)
>         at
> net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition.generateContents(GitParameterDefinition.java:316)
>         at
> net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition.getTagMap(GitParameterDefinition.java:366)
>         ... 163 more
> Caused by: hudson.plugins.git.GitException: Error performing command: git
> tag -l J-E3C*
>         at
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1283)
>         at
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1253)
>         at
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1249)
>         at
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getTagNames(CliGitAPIImpl.java:1688)
>         ... 165 more
> Caused by: java.io.IOException: Cannot run program "git" (in directory
> "/home/jenkins/jobs/Elexis-3.0-Core-Releases/workspace"): error=2, No such
> file or directory
>         at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
>         at hudson.Proc$LocalProc.<init>(Proc.java:244)
>         at hudson.Proc$LocalProc.<init>(Proc.java:216)
>         at hudson.Launcher$LocalLauncher.launch(Launcher.java:773)
>         at hudson.Launcher$ProcStarter.start(Launcher.java:353)
>         at
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1272)
>
> How should I resolve this problem?  Create an empty
> /home/jenkins/jobs/Elexis-3.0-Core-Releases/workspace directory? With which
> API? Or create and cd to a temporary directory?
>
> I would be thankful if you could give a hint to the Jenkins newbie I am.
>
> Thanks in advance.
>
> Niklaus
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> 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 Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to