View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0015291 | CMake | CMake | public | 2014-12-08 10:08 | 2016-06-10 14:21 | ||||
Reporter | Ilya | ||||||||
Assigned To | Brad King | ||||||||
Priority | normal | Severity | feature | Reproducibility | have not tried | ||||
Status | closed | Resolution | fixed | ||||||
Platform | OS | OS Version | |||||||
Product Version | |||||||||
Target Version | CMake 3.6 | Fixed in Version | CMake 3.6 | ||||||
Summary | 0015291: The ExternalProject should use the --depth option when working with git | ||||||||
Description | Right now ExternalProject does full clone of both main repo and its submodules. It doesn't make sense since we're only interested in either most recent version of branch or specific commit. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | ![]() | ||||||||
Relationships | |
Relationships |
Notes | |
(0037405) Brad King (manager) 2014-12-08 11:11 |
Some projects use ExternalProject just to configure a set of builds with Git work trees that a developer can then pick up and continue. Also as commits are added to the original repository the value of --depth needed to get back to the desired commit increases. This could be added as a GIT_DEPTH option, but no depth should be used by default. |
(0037421) Ilya (reporter) 2014-12-09 02:41 |
Maybe generic options like GIT_OPTIONS and GIT_SUBMODULE_OPTIONS would be better than just GIT_DEPTH? |
(0037422) Ilya (reporter) 2014-12-09 05:39 |
By doing this we also address the issue, that CMake clones submodules without recursion. |
(0037424) Brad King (manager) 2014-12-09 08:18 |
The problem with generic options is that they need to define which command lines they apply to ("git fetch" v. "git clone" for example). Once we define such options then it restricts our ability to change the commands that are used underneath in the future. One can always use DOWNLOAD_COMMAND and UPDATE_COMMAND with custom git calls. |
(0037428) Ilya (reporter) 2014-12-09 12:43 |
@Brad I believe it's easier to install proper version of git rather than cmake to mitigate incompatibility. With GIT_OPTIONS / GIT_SUBMODULE_OPTIONS a user will be able to fix options and move to the most recent version of git easily. If such options are hidden by cmake, user will be forced to use outdated version of git. |
(0037430) Brad King (manager) 2014-12-09 15:22 |
Re 0015291:0037428: This is not about Git version compatibility. It's about future flexibility of how the Git-based ExternalProject download and update steps are implemented. If we guarantee any specific commands will be used in order to honor GIT_OPTIONS then we will never be able to change to different/better commands to fix other problems or add other features. Users that want Git to be run a very specific way should just set DOWNLOAD_COMMAND and UPDATE_COMMAND themselves. Declarative options like GIT_DEPTH or GIT_SUBMODULE_RECURSIVE can be added without forcing specific commands to be used underneath to honor them. |
(0037542) Ilya (reporter) 2015-01-02 02:33 |
@Brad. Then I agree. Can we expect GIT_DEPTH/GIT_SUBMODULE_RECURSIVE in 3.1.1 ? |
(0037630) Brad King (manager) 2015-01-08 11:01 |
Re 0015291:0037542: 3.1.1 will only be for regression fixes. If anyone wants to work on a patch to add this feature it can be considered as part of post-3.1 development. |
(0039562) Ilya (reporter) 2015-10-10 12:28 |
Anyone? |
(0040931) Ilya (reporter) 2016-04-26 19:03 |
Brad, attached the patch. I added option called GIT_SHALLOW, because it's likely that developer needs either 1 or all commits. |
(0040932) Brad King (manager) 2016-04-27 08:56 |
Re 0015291:0040931: Thanks! I applied a change based on the patch here: ExternalProject: Add option to perform a shallow Git clone https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0209d234 [^] |
(0040933) Ilya (reporter) 2016-04-27 10:14 |
Brad, I just realized that this option can only be used with branches. Worth to add to the docs. |
(0040934) Brad King (manager) 2016-04-27 10:23 |
Re 0015291:0040933: Thanks. Please propose wording for the GIT_SHALLOW docs that explains this, perhaps referencing the GIT_TAG option (which can name a branch, tag, or raw SHA-1). |
(0040935) Ilya (reporter) 2016-04-27 10:29 |
What about: Tell Git to clone with ``--depth 1`` which will download the tip of a branch specified by GIT_TAG |
(0040936) Brad King (manager) 2016-04-27 10:43 |
Re 0015291:0040935: Thanks. How about? Tell Git to clone with ``--depth 1``. Use when ``GIT_TAG`` is not specified or when it names a branch in order to download only the tip of the branch without the rest of its history. ? |
(0040937) Ilya (reporter) 2016-04-27 10:50 |
Looks good to me. |
(0040938) Brad King (manager) 2016-04-27 10:58 |
I've revised the commit with the updated docs: ExternalProject: Add option to perform a shallow Git clone https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7db9f3f2 [^] |
(0041183) Kitware Robot (administrator) 2016-06-10 14:21 |
This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2014-12-08 10:08 | Ilya | New Issue | |
2014-12-08 11:11 | Brad King | Note Added: 0037405 | |
2014-12-09 02:41 | Ilya | Note Added: 0037421 | |
2014-12-09 05:39 | Ilya | Note Added: 0037422 | |
2014-12-09 08:18 | Brad King | Note Added: 0037424 | |
2014-12-09 12:43 | Ilya | Note Added: 0037428 | |
2014-12-09 15:22 | Brad King | Note Added: 0037430 | |
2015-01-02 02:33 | Ilya | Note Added: 0037542 | |
2015-01-08 11:01 | Brad King | Note Added: 0037630 | |
2015-10-10 12:28 | Ilya | Note Added: 0039562 | |
2016-04-26 19:02 | Ilya | File Added: ExternalProject.patch | |
2016-04-26 19:03 | Ilya | Note Added: 0040931 | |
2016-04-27 08:56 | Brad King | Note Added: 0040932 | |
2016-04-27 08:56 | Brad King | Assigned To | => Brad King |
2016-04-27 08:56 | Brad King | Status | new => resolved |
2016-04-27 08:56 | Brad King | Resolution | open => fixed |
2016-04-27 08:56 | Brad King | Fixed in Version | => CMake 3.6 |
2016-04-27 08:56 | Brad King | Target Version | => CMake 3.6 |
2016-04-27 10:14 | Ilya | Note Added: 0040933 | |
2016-04-27 10:23 | Brad King | Note Added: 0040934 | |
2016-04-27 10:29 | Ilya | Note Added: 0040935 | |
2016-04-27 10:43 | Brad King | Note Added: 0040936 | |
2016-04-27 10:50 | Ilya | Note Added: 0040937 | |
2016-04-27 10:58 | Brad King | Note Added: 0040938 | |
2016-06-10 14:21 | Kitware Robot | Note Added: 0041183 | |
2016-06-10 14:21 | Kitware Robot | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |