[1/3] maven-scm git commit: [SCM-739] Use shallow clones when cloning a git repo

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[1/3] maven-scm git commit: [SCM-739] Use shallow clones when cloning a git repo

olamy
Repository: maven-scm
Updated Branches:
  refs/heads/master d34b4d0d3 -> 1ab4a7b16


[SCM-739] Use shallow clones when cloning a git repo

For `maven-release-plugin` we don't need the whole history, but
only the top commit. Using `--depth 1` allows to perform releases
much faster on repositories with a long history.


Project: http://git-wip-us.apache.org/repos/asf/maven-scm/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-scm/commit/c041868b
Tree: http://git-wip-us.apache.org/repos/asf/maven-scm/tree/c041868b
Diff: http://git-wip-us.apache.org/repos/asf/maven-scm/diff/c041868b

Branch: refs/heads/master
Commit: c041868bf8c543cecb34c8f002f02438e6f81b52
Parents: 4c13db8
Author: Artem Prigoda <[hidden email]>
Authored: Wed Nov 22 16:52:00 2017 +0100
Committer: Artem Prigoda <[hidden email]>
Committed: Wed Nov 22 16:53:50 2017 +0100

----------------------------------------------------------------------
 .../provider/git/gitexe/command/checkout/GitCheckOutCommand.java  | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-scm/blob/c041868b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java
----------------------------------------------------------------------
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/checkout/GitCheckOutCommand.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java
index 33431e5..423180a 100644
--- a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java
@@ -167,6 +167,9 @@ public class GitCheckOutCommand
     {
         Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory.getParentFile(), "clone" );
 
+        cl.createArg().setValue( "--depth" );
+        cl.createArg().setValue( "1" );
+
         if ( version != null && ( version instanceof ScmBranch ) )
         {
 

Reply | Threaded
Open this post in threaded view
|

[2/3] maven-scm git commit: [SCM-739] Add a shallow option for a check out command

olamy
[SCM-739] Add a shallow option for a check out command

This option will allow the invoke to control the clone behaviour.


Project: http://git-wip-us.apache.org/repos/asf/maven-scm/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-scm/commit/8c65cb04
Tree: http://git-wip-us.apache.org/repos/asf/maven-scm/tree/8c65cb04
Diff: http://git-wip-us.apache.org/repos/asf/maven-scm/diff/8c65cb04

Branch: refs/heads/master
Commit: 8c65cb040f14828d34533a58cd52dca9f59a19c7
Parents: c041868
Author: Artem Prigoda <[hidden email]>
Authored: Fri Nov 24 20:15:02 2017 +0100
Committer: Artem Prigoda <[hidden email]>
Committed: Fri Nov 24 20:23:06 2017 +0100

----------------------------------------------------------------------
 .../org/apache/maven/scm/CommandParameter.java   |  2 ++
 .../checkout/AbstractCheckOutCommand.java        | 19 ++++++++-----------
 .../command/checkout/BazaarCheckOutCommand.java  |  2 +-
 .../checkout/ClearCaseCheckOutCommand.java       |  2 +-
 .../hg/command/checkout/HgCheckOutCommand.java   |  2 +-
 .../checkout/IntegrityCheckOutCommand.java       |  2 +-
 .../command/checkout/JazzCheckOutCommand.java    |  2 +-
 .../command/checkout/LocalCheckOutCommand.java   |  2 +-
 .../checkout/PerforceCheckOutCommand.java        |  2 +-
 .../checkout/StarteamCheckOutCommand.java        |  2 +-
 .../command/checkout/SynergyCheckOutCommand.java |  2 +-
 .../provider/tfs/command/TfsCheckOutCommand.java |  2 +-
 .../commands/checkout/VssCheckOutCommand.java    |  2 +-
 .../checkout/AbstractCvsCheckOutCommand.java     |  2 +-
 .../command/checkout/GitCheckOutCommand.java     | 14 +++++++++-----
 .../command/checkout/JGitCheckOutCommand.java    |  2 +-
 .../command/checkout/SvnCheckOutCommand.java     |  2 +-
 17 files changed, 33 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-scm/blob/8c65cb04/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java
----------------------------------------------------------------------
diff --git a/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java b/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java
index cb7de83..c8edd35 100644
--- a/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java
+++ b/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java
@@ -34,6 +34,8 @@ public class CommandParameter
 
     public static final CommandParameter RECURSIVE = new CommandParameter( "recursive" );
 
+    public static final CommandParameter SHALLOW = new CommandParameter( "shallow" );
+
     public static final CommandParameter MESSAGE = new CommandParameter( "message" );
 
     public static final CommandParameter BRANCH_NAME = new CommandParameter( "branchName" );

http://git-wip-us.apache.org/repos/asf/maven-scm/blob/8c65cb04/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutCommand.java b/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutCommand.java
index 9a0443b..56fb77c 100644
--- a/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutCommand.java
+++ b/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutCommand.java
@@ -45,13 +45,13 @@ public abstract class AbstractCheckOutCommand
      * @param scmVersion not null
      * @return the checkout result
      * @throws ScmException if any
-     * @see #executeCheckOutCommand(ScmProviderRepository, ScmFileSet, ScmVersion, boolean)
+     * @see #executeCheckOutCommand(ScmProviderRepository, ScmFileSet, ScmVersion, boolean, boolean)
      */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet,
                                                                  ScmVersion scmVersion )
         throws ScmException
     {
-        return executeCheckOutCommand( repository, fileSet, scmVersion, true );
+        return executeCheckOutCommand( repository, fileSet, scmVersion, true, false );
     }
 
     /**
@@ -61,12 +61,14 @@ public abstract class AbstractCheckOutCommand
      * @param fileSet not null
      * @param scmVersion not null
      * @param recursive <code>true</code> if recursive check out is wanted, <code>false</code> otherwise.
+     * @param shallow <code>true</code> if shallow check out is wanted, <code>false</code> otherwise.
      * @return the checkout result
      * @throws ScmException if any
      * @since 1.1.1
      */
     protected abstract CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet,
-                                                                 ScmVersion scmVersion, boolean recursive )
+                                                                ScmVersion scmVersion, boolean recursive,
+                                                                boolean shallow )
         throws ScmException;
 
     /** {@inheritDoc} */
@@ -75,13 +77,8 @@ public abstract class AbstractCheckOutCommand
         throws ScmException
     {
         ScmVersion scmVersion = parameters.getScmVersion( CommandParameter.SCM_VERSION, null );
-        String recursiveParam = parameters.getString( CommandParameter.RECURSIVE, null );
-        if ( recursiveParam != null )
-        {
-            boolean recursive = parameters.getBoolean( CommandParameter.RECURSIVE );
-            return executeCheckOutCommand( repository, fileSet, scmVersion, recursive );
-        }
-
-        return executeCheckOutCommand( repository, fileSet, scmVersion );
+        boolean recursive = parameters.getBoolean( CommandParameter.RECURSIVE, true );
+        boolean shallow = parameters.getBoolean( CommandParameter.SHALLOW, false );
+        return executeCheckOutCommand( repository, fileSet, scmVersion, recursive, shallow);
     }
 }

http://git-wip-us.apache.org/repos/asf/maven-scm/blob/8c65cb04/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/checkout/BazaarCheckOutCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/checkout/BazaarCheckOutCommand.java b/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/checkout/BazaarCheckOutCommand.java
index 9572542..96928e1 100644
--- a/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/checkout/BazaarCheckOutCommand.java
+++ b/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/checkout/BazaarCheckOutCommand.java
@@ -48,7 +48,7 @@ public class BazaarCheckOutCommand
 {
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet,
-                                                        ScmVersion version, boolean recursive )
+                                                       ScmVersion version, boolean recursive, boolean shallow )
         throws ScmException
     {
         BazaarScmProviderRepository repository = (BazaarScmProviderRepository) repo;

http://git-wip-us.apache.org/repos/asf/maven-scm/blob/8c65cb04/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommand.java b/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommand.java
index ad0e66b..362412d 100644
--- a/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommand.java
+++ b/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommand.java
@@ -57,7 +57,7 @@ public class ClearCaseCheckOutCommand
 
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet,
-                                                        ScmVersion version, boolean recursive )
+                                                       ScmVersion version, boolean recursive, boolean shallow )
         throws ScmException
     {
         if ( getLogger().isDebugEnabled() )

http://git-wip-us.apache.org/repos/asf/maven-scm/blob/8c65cb04/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkout/HgCheckOutCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkout/HgCheckOutCommand.java b/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkout/HgCheckOutCommand.java
index 4b1b37f..747a43d 100644
--- a/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkout/HgCheckOutCommand.java
+++ b/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkout/HgCheckOutCommand.java
@@ -52,7 +52,7 @@ public class HgCheckOutCommand
      * {@inheritDoc}
      */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet,
-                                                        ScmVersion scmVersion, boolean recursive )
+                                                       ScmVersion scmVersion, boolean recursive, boolean shallow )
         throws ScmException
     {
         HgScmProviderRepository repository = (HgScmProviderRepository) repo;

http://git-wip-us.apache.org/repos/asf/maven-scm/blob/8c65cb04/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/checkout/IntegrityCheckOutCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/checkout/IntegrityCheckOutCommand.java b/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/checkout/IntegrityCheckOutCommand.java
index f44921d..8e3d500 100644
--- a/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/checkout/IntegrityCheckOutCommand.java
+++ b/maven-scm-providers/maven-scm-provider-integrity/src/main/java/org/apache/maven/scm/provider/integrity/command/checkout/IntegrityCheckOutCommand.java
@@ -60,7 +60,7 @@ public class IntegrityCheckOutCommand
      */
     @Override
     public CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet,
-                                                     ScmVersion scmVersion, boolean recursive )
+                                                    ScmVersion scmVersion, boolean recursive, boolean shallow )
         throws ScmException
     {
         CheckOutScmResult result;

http://git-wip-us.apache.org/repos/asf/maven-scm/blob/8c65cb04/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/checkout/JazzCheckOutCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/checkout/JazzCheckOutCommand.java b/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/checkout/JazzCheckOutCommand.java
index 5ace891..3bd4a7c 100644
--- a/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/checkout/JazzCheckOutCommand.java
+++ b/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/checkout/JazzCheckOutCommand.java
@@ -55,7 +55,7 @@ public class JazzCheckOutCommand
      * {@inheritDoc}
      */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet,
-                                                        ScmVersion scmVersion, boolean recursive )
+                                                       ScmVersion scmVersion, boolean recursive, boolean shallow )
         throws ScmException
     {
         // TODO - Figure out how this recursive boolean impacts Jazz SCM "checkout" (load).

http://git-wip-us.apache.org/repos/asf/maven-scm/blob/8c65cb04/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.java b/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.java
index 306d19b..254b996 100644
--- a/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.java
+++ b/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.java
@@ -47,7 +47,7 @@ public class LocalCheckOutCommand
 {
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet,
-                                                        ScmVersion version, boolean recursive )
+                                                       ScmVersion version, boolean recursive, boolean shallow )
         throws ScmException
     {
         LocalScmProviderRepository repository = (LocalScmProviderRepository) repo;

http://git-wip-us.apache.org/repos/asf/maven-scm/blob/8c65cb04/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkout/PerforceCheckOutCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkout/PerforceCheckOutCommand.java b/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkout/PerforceCheckOutCommand.java
index a64a487..e555196 100644
--- a/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkout/PerforceCheckOutCommand.java
+++ b/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkout/PerforceCheckOutCommand.java
@@ -65,7 +65,7 @@ public class PerforceCheckOutCommand
      * {@inheritDoc}
      */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet files,
-                                                        ScmVersion version, boolean recursive )
+                                                       ScmVersion version, boolean recursive, boolean shallow )
         throws ScmException
     {
         PerforceScmProviderRepository prepo = (PerforceScmProviderRepository) repo;

http://git-wip-us.apache.org/repos/asf/maven-scm/blob/8c65cb04/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommand.java b/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommand.java
index 3ce5df2..91a9fe7 100644
--- a/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommand.java
+++ b/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommand.java
@@ -51,7 +51,7 @@ public class StarteamCheckOutCommand
 
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet,
-                                                        ScmVersion version, boolean recursive )
+                                                       ScmVersion version, boolean recursive, boolean shallow )
         throws ScmException
     {
         if ( fileSet.getFileList().size() != 0 )

http://git-wip-us.apache.org/repos/asf/maven-scm/blob/8c65cb04/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/checkout/SynergyCheckOutCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/checkout/SynergyCheckOutCommand.java b/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/checkout/SynergyCheckOutCommand.java
index 9085111..6192f44 100644
--- a/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/checkout/SynergyCheckOutCommand.java
+++ b/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/checkout/SynergyCheckOutCommand.java
@@ -49,7 +49,7 @@ public class SynergyCheckOutCommand
 
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet,
-                                                        ScmVersion version, boolean recursive )
+                                                       ScmVersion version, boolean recursive, boolean shallow )
         throws ScmException
     {
         if ( fileSet.getFileList().size() != 0 )

http://git-wip-us.apache.org/repos/asf/maven-scm/blob/8c65cb04/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsCheckOutCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsCheckOutCommand.java b/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsCheckOutCommand.java
index 2aa1eac..7aa5e77 100644
--- a/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsCheckOutCommand.java
+++ b/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsCheckOutCommand.java
@@ -38,7 +38,7 @@ public class TfsCheckOutCommand
 {
 
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository r, ScmFileSet f, ScmVersion v,
-                                                        boolean recursive )
+                                                       boolean recursive, boolean shallow )
         throws ScmException
     {
         TfsScmProviderRepository tfsRepo = (TfsScmProviderRepository) r;

http://git-wip-us.apache.org/repos/asf/maven-scm/blob/8c65cb04/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutCommand.java b/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutCommand.java
index c936fc0..4cf8802 100644
--- a/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutCommand.java
+++ b/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutCommand.java
@@ -41,7 +41,7 @@ public class VssCheckOutCommand
 
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet,
-                                                        ScmVersion version, boolean recursive )
+                                                       ScmVersion version, boolean recursive, boolean shallow )
         throws ScmException
     {
         if ( getLogger().isDebugEnabled() )

http://git-wip-us.apache.org/repos/asf/maven-scm/blob/8c65cb04/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/AbstractCvsCheckOutCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/AbstractCvsCheckOutCommand.java b/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/AbstractCvsCheckOutCommand.java
index 5ef9091..e47b31d 100644
--- a/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/AbstractCvsCheckOutCommand.java
+++ b/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/AbstractCvsCheckOutCommand.java
@@ -45,7 +45,7 @@ public abstract class AbstractCvsCheckOutCommand
 {
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet,
-                                                        ScmVersion version, boolean recursive )
+                                                       ScmVersion version, boolean recursive, boolean shallow )
         throws ScmException
     {
         if ( fileSet.getBasedir().exists() )

http://git-wip-us.apache.org/repos/asf/maven-scm/blob/8c65cb04/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java
----------------------------------------------------------------------
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/checkout/GitCheckOutCommand.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java
index 423180a..296e51b 100644
--- a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java
@@ -58,7 +58,7 @@ public class GitCheckOutCommand
      * {@inheritDoc}
      */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet,
-                                                        ScmVersion version, boolean recursive )
+                                                       ScmVersion version, boolean recursive, boolean shallow )
         throws ScmException
     {
         GitScmProviderRepository repository = (GitScmProviderRepository) repo;
@@ -85,7 +85,7 @@ public class GitCheckOutCommand
             }
 
             // no git repo seems to exist, let's clone the original repo
-            Commandline clClone = createCloneCommand( repository, fileSet.getBasedir(), version );
+            Commandline clClone = createCloneCommand( repository, fileSet.getBasedir(), version, shallow );
 
             exitCode = GitCommandLineUtils.execute( clClone, stdout, stderr, getLogger() );
             if ( exitCode != 0 )
@@ -163,12 +163,16 @@ public class GitCheckOutCommand
      * create a git-clone repository command
      */
     private Commandline createCloneCommand( GitScmProviderRepository repository, File workingDirectory,
-                                            ScmVersion version )
+                                            ScmVersion version, boolean shallow )
     {
         Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory.getParentFile(), "clone" );
 
-        cl.createArg().setValue( "--depth" );
-        cl.createArg().setValue( "1" );
+        if ( shallow )
+        {
+            cl.createArg().setValue( "--depth" );
+
+            cl.createArg().setValue( "1" );
+        }
 
         if ( version != null && ( version instanceof ScmBranch ) )
         {

http://git-wip-us.apache.org/repos/asf/maven-scm/blob/8c65cb04/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/checkout/JGitCheckOutCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/checkout/JGitCheckOutCommand.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/checkout/JGitCheckOutCommand.java
index 178230c..60f3d44 100644
--- a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/checkout/JGitCheckOutCommand.java
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/checkout/JGitCheckOutCommand.java
@@ -66,7 +66,7 @@ public class JGitCheckOutCommand
      * {@inheritDoc}
      */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet,
-                                                        ScmVersion version, boolean recursive )
+                                                       ScmVersion version, boolean recursive, boolean shallow )
         throws ScmException
     {
         GitScmProviderRepository repository = (GitScmProviderRepository) repo;

http://git-wip-us.apache.org/repos/asf/maven-scm/blob/8c65cb04/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommand.java b/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommand.java
index 1d0419b..0379047 100644
--- a/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommand.java
+++ b/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommand.java
@@ -54,7 +54,7 @@ public class SvnCheckOutCommand
      * {@inheritDoc}
      */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet,
-                                                        ScmVersion version, boolean recursive )
+                                                       ScmVersion version, boolean recursive, boolean shallow )
         throws ScmException
     {
         SvnScmProviderRepository repository = (SvnScmProviderRepository) repo;

Reply | Threaded
Open this post in threaded view
|

[3/3] maven-scm git commit: Merge branch 'pr-56' close #56

olamy
In reply to this post by olamy
Merge branch 'pr-56'
close #56


Project: http://git-wip-us.apache.org/repos/asf/maven-scm/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-scm/commit/1ab4a7b1
Tree: http://git-wip-us.apache.org/repos/asf/maven-scm/tree/1ab4a7b1
Diff: http://git-wip-us.apache.org/repos/asf/maven-scm/diff/1ab4a7b1

Branch: refs/heads/master
Commit: 1ab4a7b16bb941aa9a1fe8c824ef6a94e5bc2944
Parents: d34b4d0 8c65cb0
Author: olivier lamy <[hidden email]>
Authored: Sat Dec 2 10:12:35 2017 +1100
Committer: olivier lamy <[hidden email]>
Committed: Sat Dec 2 10:12:35 2017 +1100

----------------------------------------------------------------------
 .../org/apache/maven/scm/CommandParameter.java   |  2 ++
 .../checkout/AbstractCheckOutCommand.java        | 19 ++++++++-----------
 .../command/checkout/BazaarCheckOutCommand.java  |  2 +-
 .../checkout/ClearCaseCheckOutCommand.java       |  2 +-
 .../hg/command/checkout/HgCheckOutCommand.java   |  2 +-
 .../checkout/IntegrityCheckOutCommand.java       |  2 +-
 .../command/checkout/JazzCheckOutCommand.java    |  2 +-
 .../command/checkout/LocalCheckOutCommand.java   |  2 +-
 .../checkout/PerforceCheckOutCommand.java        |  2 +-
 .../checkout/StarteamCheckOutCommand.java        |  2 +-
 .../command/checkout/SynergyCheckOutCommand.java |  2 +-
 .../provider/tfs/command/TfsCheckOutCommand.java |  2 +-
 .../commands/checkout/VssCheckOutCommand.java    |  2 +-
 .../checkout/AbstractCvsCheckOutCommand.java     |  2 +-
 .../command/checkout/GitCheckOutCommand.java     | 13 ++++++++++---
 .../command/checkout/JGitCheckOutCommand.java    |  2 +-
 .../command/checkout/SvnCheckOutCommand.java     |  2 +-
 17 files changed, 34 insertions(+), 28 deletions(-)
----------------------------------------------------------------------