[cmake-developers] [CMake 0015512]: CTest git update to specific commit reivision / CTEST_GIT_UPDATE_CUSTOM with multiple git commands

Mantis Bug Tracker mantis at public.kitware.com
Mon Apr 13 11:56:05 EDT 2015


The following issue has been SUBMITTED. 
====================================================================== 
https://public.kitware.com/Bug/view.php?id=15512 
====================================================================== 
Reported By:                trsystran
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15512
Category:                   CTest
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-04-13 11:56 EDT
Last Modified:              2015-04-13 11:56 EDT
====================================================================== 
Summary:                    CTest git update to specific commit reivision /
CTEST_GIT_UPDATE_CUSTOM with multiple git commands
Description: 
Scenario:
Update in ctest the source git checkout to a given git commit revision (sha-1).

It's currently not possible to do that.

* GITUpdateOptions is only appended to "git" "fetch", then a "git" "reset"
"--hard" to FETCH_HEAD is done, and "git fetch" only takes refspec, not sha-1
commit revisions, so set(CTEST_GIT_UPDATE_OPTIONS "origin ${REVISION}") doesn't
work

* GITUpdateCustom takes only *one* command-line, contrary to what the ctest
manual says ("Specify a semicolon-separated list of custom command lines to run
in the source tree (Git work tree) to update it instead of running the
GITCommand.")
The code (in 2.8.12.2 and 3.2.1, it didn't change) split on ';', then adds each
token as an argument of one process execution, not multiple command lines as
documented.
So it's not possible do this:
set(CTEST_GIT_UPDATE_CUSTOM "git fetch" "git reset --hard ${REVISION}")
because it will try to execute "git fetch" program, instead of "git".

I haven't found a way to do fetch + reset on a given commit revision in one
command (git fetch and git pull take refspec, not revisions, and git rebase take
just branches).


Two issues here:
1/ improve documentation to remove the plural mark on "command line" to reflect
the current behavior (it's the same wording and issue for P4)
2/ find a solution to update to a given git commit revision (changing
CTEST_GIT_UPDATE_CUSTOM behavior to match the documentation would be a breaking
change, so it's not the solution.)



Additional Information: 
With SVN it symply works with set(CTEST_SVN_UPDATE_OPTIONS "-r${REVISION}")
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-04-13 11:56 trsystran      New Issue                                    
======================================================================



More information about the cmake-developers mailing list