You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2018/05/11 00:45:17 UTC
[maven-scm] branch SCM-797 updated (a6cd4ea -> f3877d9)
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a change to branch SCM-797
in repository https://gitbox.apache.org/repos/asf/maven-scm.git.
discard a6cd4ea [SCM-797] gitexe checkIn() fails due to Windows command line length limitation
add 9cbbb1f [SCM-887] Plexus Utils 3.0.24 makes some tests fail
new f3877d9 [SCM-797] gitexe checkIn() fails due to Windows command line length limitation
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (a6cd4ea)
\
N -- N -- N refs/heads/SCM-797 (f3877d9)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../accurev/cli/AccuRevCommandLineTest.java | 18 +++----
.../provider/jazz/command/JazzScmCommandTest.java | 36 +++++++++++---
.../scm/provider/synergy/util/SynergyCCMTest.java | 58 ++++++++++++----------
.../svn/svnexe/command/SvnCommandLineUtils.java | 47 +++++++++++-------
4 files changed, 98 insertions(+), 61 deletions(-)
--
To stop receiving notification emails like this one, please contact
michaelo@apache.org.
[maven-scm] 01/01: [SCM-797] gitexe checkIn() fails due to Windows
command line length limitation
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch SCM-797
in repository https://gitbox.apache.org/repos/asf/maven-scm.git
commit f3877d91d0d68f3655bd669e07647eb88c88429e
Author: Rado Murin <ra...@gmail.com>
AuthorDate: Mon Apr 13 09:34:57 2015 +0200
[SCM-797] gitexe checkIn() fails due to Windows command line length
limitation
This workaround executes 'git add' on a per-file basis to avoid length
limitation. The git commit has to be a generic one to avoid another
failure by providing the same lengthly list again.
This closes #30, #41, #49
---
.../gitexe/command/checkin/GitCheckInCommand.java | 54 ++++++++++++++--------
1 file changed, 35 insertions(+), 19 deletions(-)
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkin/GitCheckInCommand.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkin/GitCheckInCommand.java
index e30aae0..1766aca 100644
--- a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkin/GitCheckInCommand.java
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkin/GitCheckInCommand.java
@@ -38,6 +38,7 @@ import org.apache.maven.scm.provider.git.gitexe.command.branch.GitBranchCommand;
import org.apache.maven.scm.provider.git.gitexe.command.status.GitStatusCommand;
import org.apache.maven.scm.provider.git.gitexe.command.status.GitStatusConsumer;
import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.Os;
import org.codehaus.plexus.util.cli.CommandLineUtils;
import org.codehaus.plexus.util.cli.Commandline;
@@ -45,6 +46,7 @@ import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
/**
@@ -66,7 +68,7 @@ public class GitCheckInCommand
CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
- int exitCode;
+ int exitCode = -1;
File messageFile = FileUtils.createTempFile( "maven-scm-", ".commit", null );
try
@@ -86,27 +88,46 @@ public class GitCheckInCommand
// if specific fileSet is given, we have to git-add them first
// otherwise we will use 'git-commit -a' later
- Commandline clAdd = GitAddCommand.createCommandLine( fileSet.getBasedir(), fileSet.getFileList() );
+ Commandline clAdd = null;
- exitCode = GitCommandLineUtils.execute( clAdd, stdout, stderr, getLogger() );
+ //SCM-714: Workaround for the Windows terminal command limit
+ if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
+ {
+ for ( File file: fileSet.getFileList() )
+ {
+ clAdd = GitAddCommand.createCommandLine( fileSet.getBasedir(),
+ Collections.singletonList( file ) );
+ exitCode = GitCommandLineUtils.execute( clAdd, stdout, stderr, getLogger() );
+
+ if ( exitCode != 0 )
+ {
+ break;
+ }
+ }
+ }
+ else
+ {
+ clAdd = GitAddCommand.createCommandLine( fileSet.getBasedir(), fileSet.getFileList() );
+ exitCode = GitCommandLineUtils.execute( clAdd, stdout, stderr, getLogger() );
+ }
if ( exitCode != 0 )
{
- return new CheckInScmResult( clAdd.toString(), "The git-add command failed.", stderr.getOutput(),
- false );
+ return new CheckInScmResult( clAdd.toString(), "The git-add command failed.",
+ stderr.getOutput(), false );
}
}
-
+
// SCM-709: statusCommand uses repositoryRoot instead of workingDirectory, adjust it with
// relativeRepositoryPath
Commandline clRevparse = GitStatusCommand.createRevparseShowToplevelCommand( fileSet );
-
+
stdout = new CommandLineUtils.StringStreamConsumer();
stderr = new CommandLineUtils.StringStreamConsumer();
URI relativeRepositoryPath = null;
-
+
exitCode = GitCommandLineUtils.execute( clRevparse, stdout, stderr, getLogger() );
if ( exitCode != 0 )
{
@@ -139,7 +160,7 @@ public class GitCheckInCommand
+ "track)" );
}
}
-
+
if ( statusConsumer.getChangedFiles().isEmpty() )
{
return new CheckInScmResult( null, statusConsumer.getChangedFiles() );
@@ -154,7 +175,7 @@ public class GitCheckInCommand
false );
}
- if ( repo.isPushChanges() )
+ if ( repo.isPushChanges() )
{
Commandline cl = createPushCommandLine( getLogger(), repository, fileSet, version );
@@ -163,7 +184,7 @@ public class GitCheckInCommand
{
return new CheckInScmResult( cl.toString(), "The git-push command failed.", stderr.getOutput(),
false );
- }
+ }
}
List<ScmFile> checkedInFiles = new ArrayList<ScmFile>( statusConsumer.getChangedFiles().size() );
@@ -218,14 +239,14 @@ public class GitCheckInCommand
Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( fileSet.getBasedir(), "push" );
String branch = GitBranchCommand.getCurrentBranch( logger, repository, fileSet );
-
+
if ( branch == null || branch.length() == 0 )
{
throw new ScmException( "Could not detect the current branch. Don't know where I should push to!" );
}
-
+
cl.createArg().setValue( repository.getPushUrl() );
-
+
cl.createArg().setValue( "refs/heads/" + branch + ":" + "refs/heads/" + branch );
return cl;
@@ -248,11 +269,6 @@ public class GitCheckInCommand
// commit all tracked files
cl.createArg().setValue( "-a" );
}
- else
- {
- // specify exactly which files to commit
- GitCommandLineUtils.addTarget( cl, fileSet.getFileList() );
- }
if ( GitUtil.getSettings().isCommitNoVerify() )
{
--
To stop receiving notification emails like this one, please contact
michaelo@apache.org.