[
https://issues.apache.org/jira/browse/SCM-668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17964857#comment-17964857
]
Olivier Lamy commented on SCM-668:
----------------------------------
This project has moved from Jira to GitHub Issues. This issue was migrated to
[apache/maven-scm#881|https://github.com/apache/maven-scm/issues/881].
> Unable to get revision number with Git and SVN 1.7
> --------------------------------------------------
>
> Key: SCM-668
> URL: https://issues.apache.org/jira/browse/SCM-668
> Project: Maven SCM (Moved to GitHub Issues)
> 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
> Priority: Major
>
> 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 was sent by Atlassian Jira
(v8.20.10#820010)