MantisBT - CMake
View Issue Details
0015722CMakeModulespublic2015-08-31 15:492016-02-01 09:10
Kevin Godby 
Daniele E. Domenichelli 
normalminoralways
closedfixed 
CMake 3.3.1 
 
0015722: ExternalProject.cmake calls 'git stash save --all' even if git doesn't support --all option
The --all option for git-stash wasn't introduced until git version 1.7.6. If you use ExternalProject_Add with a git repository and have an old version of git installed, cmake will fail when it tries to call 'git stash save --all --quiet'.
* Install a old version of git (<= 1.7.5).
* Use recent version of cmake.
* Try to download a git repository using ExternalProject_Add.

No tags attached.
Issue History
2015-08-31 15:49Kevin GodbyNew Issue
2015-08-31 15:55Brad KingAssigned To => Daniele E. Domenichelli
2015-08-31 15:55Brad KingStatusnew => assigned
2015-08-31 15:56Brad KingNote Added: 0039362
2015-09-17 06:11Daniele E. DomenichelliNote Added: 0039431
2015-09-17 08:35Brad KingNote Added: 0039433
2015-09-17 08:40Daniele E. DomenichelliNote Added: 0039434
2015-09-25 11:56Daniele E. DomenichelliStatusassigned => resolved
2015-09-25 11:56Daniele E. DomenichelliResolutionopen => fixed
2016-02-01 09:10Robert MaynardNote Added: 0040420
2016-02-01 09:10Robert MaynardStatusresolved => closed

Notes
(0039362)
Brad King   
2015-08-31 15:56   
For reference, the stash call was added here:

 ExternalProject: Improve handling of git remote branches
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f2128d4c [^]

It needs to be taught to check the version of Git for support of the option.
(0039431)
Daniele E. Domenichelli   
2015-09-17 06:11   
Sorry for the delay. I just pushed a fix in the topic "ExternalProject_stash_save_all"

  * ExternalProject: Use GIT_VERSION_STRING instead of custom method
    http://www.cmake.org/gitweb?p=stage/cmake.git;a=commitdiff;h=b04c381 [^]

  * ExternalProject: Use "git stash save --all" only if supported (0015722)
    http://www.cmake.org/gitweb?p=stage/cmake.git;a=commitdiff;h=7c5b6ed [^]

I don't think there was an alternative syntax or anything similar in git 1.7.5 (--include-untracked was added together with --all) so I just removed the option for older git releases.

Unit tests should already cover this, but I don't know if there is a test machine with git < 1.7.6.

Can you please review the topic?
(0039433)
Brad King   
2015-09-17 08:35   
Re 0015722:0039431: Thanks. LGTM. Please merge for testing.
(0039434)
Daniele E. Domenichelli   
2015-09-17 08:40   
Merged into next.
Thanks.
(0040420)
Robert Maynard   
2016-02-01 09:10   
Closing resolved issues that have not been updated in more than 4 months.