Laurent Prévost created SCM-668:
-----------------------------------

             Summary: Unable to get revision number with Git and SVN 1.7
                 Key: SCM-668
                 URL: https://jira.codehaus.org/browse/SCM-668
             Project: Maven SCM
          Issue Type: Bug
          Components: maven-scm-api
    Affects Versions: 1.7
         Environment: Mac OS X Snow Leopard
Maven 2 and 3
Maven SCM 1.7 and previous ones
Multi modules project
            Reporter: Laurent Prévost


I am unable to use the plugin buildnumber-maven-plugin to get the revision 
number with Git and SVN. After some investigations, I realized that the plugin 
used the Maven-SCM-API and their providers.

The command issued by the plugin is

{code}
/bin/sh -c cd /tmp/temp/mytestingrepo && git rev-parse --verify --short=7 HEAD
{code}

I run this command directly in a shell with the following error

{code}
fatal: Not a git repository (or any of the parent directories): .git
{code}

When I modify the command like the following one, it works perfectly

{code}
/bin/sh -c "cd /tmp/temp/mytestingrepo && git rev-parse --verify --short=7 HEAD"
{code}

It seems that the command is not executed correctly on my environment where the 

{code}
/bin/sh -c "cd /tmp/temp/mytestingrepo
{code}

is executed and afterwards the command

{code}
git rev-parse --verify --short=7 HEAD
{code}

is done in the current directory. In the case of SVN 1.7 and Git, the .svn or 
.git are not located in subdirectories where the second command is executed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to