summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestGIT.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Access string npos without instancePavel Solodovnikov2017-06-011-2/+2
|
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-2/+2
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* ctest_update: Refactor internal APIs to support more failure casesBrad King2017-02-161-4/+8
| | | | | | Thread failure of VC tool commands through more APIs so that we can detect when they fail. Defer updating of the individual VC tool usage the future and just return true from them for now.
* iwyu: Fix more findingsDaniel Pfeifer2016-11-281-6/+7
|
* CTest: Use UTF-8 encoding for output from GitDāvis Mosāns2016-11-151-6/+11
|
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* CTest: fix include-what-you-use violationsDaniel Pfeifer2016-08-251-3/+5
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-16/+23
|
* Add CM_OVERRIDE to some functionsDaniel Pfeifer2016-06-271-3/+3
| | | | | | | Run clang-tidy's modernize-use-override checker. This checker must have issues in version 3.8. It has way too little matches. And it adds override to destructors. Revert the changes on the destructors and change override to CM_OVERRIDE.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-241/+225
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Source: Sort includes of sys/types.h as clang-format wouldBrad King2016-05-031-1/+1
| | | | | When this header is included in blocks where order does not matter, just place it in lexicographic order as clang-format would by default.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* cmCTestGIT: run `git submodule sync` before updating submodulesBen Boeckel2016-04-011-0/+22
| | | | | If the URL of a submodule changes upstream, the commits referenced at the old URL may not be available and will cause an update failure.
* cmCTestGIT: add an option to initialize submodules on updateBen Boeckel2016-04-011-1/+18
| | | | | | | Currently, CTest will not initialize any submodules within the already checked out source tree. Add an option to do so. The use case for not doing so is that some submodules may not be necessary for the current test and keeping network usage down may be important.
* cmCTestGIT: fix git version referencesBen Boeckel2016-04-011-3/+3
| | | | Git does not use a 4-component version number.
* Merge topic 'fix-ctest-xml-double-encoding'Brad King2015-08-311-1/+0
|\ | | | | | | | | | | | | ab2524d6 CTest: Fix XML double-encoding cases dee84dc7 cmCTest{BZR,GIT,P4}: Remove unused cmXMLSafe includes b3372db5 cmExtra{Kate,SublimeText}Generator: Remove unused cmXMLSafe includes
| * cmCTest{BZR,GIT,P4}: Remove unused cmXMLSafe includesDaniel Pfeifer2015-08-281-1/+0
| |
* | Remove use of include <cmsys/ios/*> and cmsys_ios::*Brad King2015-08-201-1/+0
|/ | | | We no longer need this compatibility layer for the compilers we support.
* Split cmAlgorithms into a separate header file.Stephen Kelly2015-02-101-0/+1
|
* strings: Remove redundant calls to std::string::c_str()Nils Gladitz2014-10-151-1/+1
| | | | | Replacements were detected and performed by the clang tool remove-cstr-calls on a linux build.
* strings: Remove cmStdString referencesBen Boeckel2014-03-081-2/+2
| | | | | | | | | | | Casts from std::string -> cmStdString were high on the list of things taking up time. Avoid such implicit casts across function calls by just using std::string everywhere. The comment that the symbol name is too long is no longer relevant since modern debuggers alias the templates anyways and the size is a non-issue since the underlying methods are generated since it's inherited.
* Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.Clinton Stimpson2014-01-071-1/+2
| | | | | Also use SystemTools::Fopen() instead of fopen(). This is to eventually support utf-8 filenames.
* Use new cmHasLiteralPrefix functionStephen Kelly2013-11-211-3/+3
|
* CTest: Fix ctest_update with 'HEAD' file in source treeBrad King2013-02-281-2/+2
| | | | | Add the '--' command-line separator to make the HEAD reference unambiguous. Extend the CTest.UpdateGIT test to cover this case.
* CTest: Do not fail with submodules and Git < 1.6.5.0Brad King2011-03-101-2/+1
| | | | | | | | | | Several major Linux distributions still do not provide Git >= 1.6.5.0 in their stable package lists. Prior to commit 1173cc4a (Update Git submodules with --recursive, 2011-02-22) CTest was able to use older Git versions but simply silently failed to update submodules recursively. Instead of failing with older Git versions preserve the status quo and add a warning in the update log. Users testing projects with recursive submodules may simply update to a Git new enough to support them.
* CTest: Update Git submodules with --recursiveBrad King2011-02-221-1/+45
| | | | | | Fail if submodules exist and the git version is less than 1.6.5.0. Inspired-by: Johan Björk <phb@spotify.com>
* CTest: Factor out duplicate Git author/committer codeBrad King2010-12-201-44/+28
| | | | | Factor out date/time format code into FormatDateTime function instead of duplicating it.
* CTest git update should pass the committer as well as the authorZach Mullen2010-12-201-0/+29
|
* Merge topic 'ctest-git-flexibility'Brad King2010-08-031-2/+84
|\ | | | | | | | | | | | | a7319cf ctest_update: Run 'git submodule' at top level 7bf8dc1 ctest_update: Support ".git file" work trees 65cb72f ctest_update: Abort if Git FETCH_HEAD has no candidates
| * ctest_update: Run 'git submodule' at top levelBrad King2010-07-271-1/+24
| | | | | | | | | | | | | | | | The git submodule porcelain must be executed from the top level of the work tree. Use 'git rev-parse --show-cdup' to find the top level relative to the source tree. This is better than searching up the tree for .git ourselves because it will always work the same way Git does and thus honors settings like GIT_DISCOVERY_ACROSS_FILESYSTEM.
| * ctest_update: Support ".git file" work treesBrad King2010-07-261-1/+54
| | | | | | | | | | | | | | Commit c3781efb (Support Git upstream branch rewrites, 2010-06-08) assumed that ".git/FETCH_HEAD" exists inside the source tree. Fix the implementation to handle a work tree using a ".git file" to link to its repository. Use "git rev-parse --git-dir" to locate the real .git dir.
| * ctest_update: Abort if Git FETCH_HEAD has no candidatesBrad King2010-07-201-0/+6
| | | | | | | | | | | | If .git/FETCH_HEAD provides no merge candidate do not attempt to update. Also log FETCH_HEAD lines as we parse them since they are essentially output from the git fetch command.
* | CTest: Parse empty Git commits correctlyBrad King2010-06-231-0/+9
|/ | | | | | | Git's diff-tree format has no '\n'-terminated blank line at the end of its commit message body block if there are no diff lines. Instead the message body is terminated by '\0' and there is no diff section. Teach CTest to parse the format in this case.
* ctest_update: Support Git upstream branch rewritesBrad King2010-06-081-13/+40
| | | | | | | | | | | | | Use 'git fetch' followed by 'git reset' to update the source tree. This is better than 'git pull' because it can handle a rewritten upstream branch and does not leave local modifications. After fetch, parse FETCH_HEAD to find the merge head that 'git pull' would choose to track the upstream branch. Then reset to the selected head. In the normal fast-forward case the behavior remains unchanged. However, now local modifications and commits will be erased, and upstream rewrites are handled smoothly. This ensures that the upstream branch is tested as expected.
* ctest_update: Support custom Git update commandBrad King2010-06-081-7/+44
| | | | | Define CTest configuration variable CTEST_GIT_UPDATE_CUSTOM to set a custom command line for updating Git-managed source trees.
* Fix ctest_update log prefix for git submodule updateBrad King2010-06-041-1/+1
| | | | | | | Commit 67277bac (Teach ctest_update about Git submodules, 2010-05-04) accidentally logged "git submodule update" with the prefixes "pull-out" and "pull-err". Fix it to use "submodule-out" and "submodule-err" instead.
* CTest: Submit author email in Update.xmlBrad King2010-05-071-0/+1
| | | | | | | Add the <Email>...</Email> element in Update.xml for each commit reported. This field was defined by Dart but never really used. Distributed version control systems use author name and email instead of a user id, so now it makes sense to use this field.
* Teach ctest_update about Git submodulesBrad King2010-05-041-2/+11
| | | | | | | | | | | Git does not automatically checkout the matching version of a submodule when it checks out a new version of the parent project in the work tree. If the submodule reference changed in the parent project then we were reporting the submodule path as a local modification. Work around the problem in ctest_update using "git submodule update" after "git pull". For projects with no submodules this is a no-op. See issue #10662. Also add a submodule to the test project for CTest.UpdateGIT to test the work-around.
* cmCTestGIT: Refresh index for local modificationsBrad King2010-02-091-2/+8
| | | | | | | | We use 'git diff-index' to detect local modifications after pull. On some filesystems the work tree timestamps of a few files may be dated after the index, making them appear as locally modified. We address the problem by using 'git update-index --refresh' to refresh the index and avoid false local modifications.
* Use human-readable Git commit times in Update.xmlBrad King2009-12-211-4/+18
| | | | | | | | | | | | | Previously we produced commit times formatted like 1261403774 -0500 which is what the Git plumbing prints. Now we use a human-readable format like 2009-12-21 15:28:06 -0500 which is still easy to machine-parse.
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.
* COMP: Fix class reference for HP aCCBrad King2009-04-221-1/+1
|
* ENH: Teach CTest to handle git repositoriesBrad King2009-04-221-0/+416
This creates cmCTestGIT to drive CTest Update handling on git-based work trees. Currently we always update to the head of the remote tracking branch (git pull), so the nightly start time is ignored for Nightly builds. A later change will address this. See issue #6994.