slawekjaranowski commented on code in PR #1412:
URL: https://github.com/apache/maven-scm/pull/1412#discussion_r4713528155


##########
maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusCommand.java:
##########
@@ -47,7 +47,7 @@ protected StatusScmResult 
executeStatusCommand(ScmProviderRepository repo, ScmFi
 
         Commandline cl = createCommandLine((GitScmProviderRepository) repo, 
fileSet);
 
-        GitStatusConsumer consumer = new 
GitStatusConsumer(fileSet.getBasedir(), relativeRepositoryPath, fileSet);
+        GitStatusConsumer consumer = new 
GitStatusConsumer(fileSet.getBasedir(), relativeRepositoryPath, fileSet, true);

Review Comment:
   Note for the release notes: the new constructors keep `GitStatusConsumer` 
source-compatible, but this line changes the behaviour of the public 
`ScmProvider.status()` API for gitexe, and that is what downstream tools call.
   
   For example, `release:prepare` (`ScmCheckModificationsPhase`) calls 
`provider.status(repository, new ScmFileSet(workingDirectory))`. It removes 
only paths matching its exclusion patterns (`release.properties`, 
`pom.xml.releaseBackup`, … plus `checkModificationExcludes`) and does not look 
at `ScmFileStatus`. So with this change, any untracked file that is not in 
`.gitignore` makes `release:prepare` fail with "Cannot prepare the release 
because you have local modifications". The same applies to 
`scm:check-local-modification`.
   
   That is the intended fix for #1170 / #1196, and svnexe already behaves this 
way. For Git users it is still a visible change, though. I'd suggest:
   
   - labelling the PR `breaking`, so it shows up in the release notes;
   - mentioning the workaround (add the files to `.gitignore`, or to 
`checkModificationExcludes` in the release plugin).
   
   JGit still ignores untracked files, so after this PR the two Git providers 
report different results for the same working copy. That is tracked in #1468.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to