View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015512CMakeCTestpublic2015-04-13 11:562015-11-02 09:13
Reportertrsystran 
Assigned To 
PrioritynormalSeveritytextReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 3.2.1 
Target VersionCMake 3.3Fixed in VersionCMake 3.3 
Summary0015512: Fix CTEST_GIT_UPDATE_CUSTOM documentation
DescriptionScenario:
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 InformationWith SVN it symply works with set(CTEST_SVN_UPDATE_OPTIONS "-r${REVISION}")
TagsNo tags attached.
Attached Files

 Relationships
related to 0014581closed The git module of CTest doesn't use the nightly timestamp for git update 

  Notes
(0038496)
Brad King (manager)
2015-04-13 13:02

I've fixed the documentation, which was just written incorrectly when added:

 Help: Fix {GIT,P4}UpdateCustom documentation
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fef1f267 [^]
(0038498)
Brad King (manager)
2015-04-13 13:04

When GITUpdateCustom was first added the intention was for it to be the minimum needed for a hook in the right spot. One can use it to invoke another script to do arbitrarily complex logic for the update.
(0038499)
trsystran (reporter)
2015-04-13 13:11

Okay, the script will do.

I consider this issue resolved, thanks!
(0039769)
Robert Maynard (manager)
2015-11-02 09:13

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2015-04-13 11:56 trsystran New Issue
2015-04-13 12:49 Brad King Relationship added related to 0014581
2015-04-13 13:02 Brad King Note Added: 0038496
2015-04-13 13:04 Brad King Note Added: 0038498
2015-04-13 13:11 trsystran Note Added: 0038499
2015-04-13 14:10 Brad King Severity minor => text
2015-04-13 14:10 Brad King Status new => resolved
2015-04-13 14:10 Brad King Resolution open => fixed
2015-04-13 14:10 Brad King Fixed in Version => CMake 3.3
2015-04-13 14:10 Brad King Target Version => CMake 3.3
2015-04-13 14:10 Brad King Summary CTest git update to specific commit reivision / CTEST_GIT_UPDATE_CUSTOM with multiple git commands => Fix CTEST_GIT_UPDATE_CUSTOM documentation
2015-11-02 09:13 Robert Maynard Note Added: 0039769
2015-11-02 09:13 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team