[ 
https://issues.apache.org/jira/browse/SCM-806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17963182#comment-17963182
 ] 

ASF GitHub Bot commented on SCM-806:
------------------------------------

jira-importer opened a new issue, #1033:
URL: https://github.com/apache/maven-scm/issues/1033

   **[Richard 
DiCroce](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=rcd)** 
opened 
**[SCM-806](https://issues.apache.org/jira/browse/SCM-806?redirect=false)** and 
commented
   
   The JGit SCM implementation only works if the path passed to its commands 
points to a Git repository directory or a directory that contains a Git 
repository directory. This behavior is different from the Git executable, which 
can be run in any subdirectory and will find the Git repository by searching 
parent directories.
   
   This difference creates a problem for the maven-release-plugin when used on 
flat multi-module projects. The prepare goal needs to check for SCM changes, 
and the JGit implementation will throw an exception, causing the release to 
fail. This happens because the path provided is the basedir of the project you 
invoke the plugin on, which is not the directory that contains the Git 
repository. As far as I can tell, there is no way to change the directory that 
maven-release-plugin passes during prepare. (The workingDirectory configuration 
option only affects the perform goal.)
   
   So I have created this patch to make the JGit implementation better mimic 
the GitExe implementation. It alters most of the commands (with the exception 
of CheckOut) to search parent directories for the repository and respect Git 
environment variables.
   
   
   ---
   
   **Affects:** 1.9.4
   
   **Attachments:**
   - 
[jgit-patch.txt](https://issues.apache.org/jira/secure/attachment/12772760/jgit-patch.txt)
 (_12.33 kB_)
   




> JGit impl should look for repositories in parent directories
> ------------------------------------------------------------
>
>                 Key: SCM-806
>                 URL: https://issues.apache.org/jira/browse/SCM-806
>             Project: Maven SCM (Moved to GitHub Issues)
>          Issue Type: Bug
>          Components: maven-scm-provider-gitexe
>    Affects Versions: 1.9.4
>            Reporter: Richard DiCroce
>            Assignee: Robert Scholte
>            Priority: Major
>             Fix For: 1.9.5
>
>         Attachments: jgit-patch.txt
>
>
> The JGit SCM implementation only works if the path passed to its commands 
> points to a Git repository directory or a directory that contains a Git 
> repository directory. This behavior is different from the Git executable, 
> which can be run in any subdirectory and will find the Git repository by 
> searching parent directories.
> This difference creates a problem for the maven-release-plugin when used on 
> flat multi-module projects. The prepare goal needs to check for SCM changes, 
> and the JGit implementation will throw an exception, causing the release to 
> fail. This happens because the path provided is the basedir of the project 
> you invoke the plugin on, which is not the directory that contains the Git 
> repository. As far as I can tell, there is no way to change the directory 
> that maven-release-plugin passes during prepare. (The workingDirectory 
> configuration option only affects the perform goal.)
> So I have created this patch to make the JGit implementation better mimic the 
> GitExe implementation. It alters most of the commands (with the exception of 
> CheckOut) to search parent directories for the repository and respect Git 
> environment variables.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to